Add redirection when form succeeds

This commit is contained in:
Hubert Van De Walle 2020-04-13 18:18:35 +02:00
parent 5d8048bc1a
commit 991452398a
2 changed files with 5 additions and 1 deletions

View File

@ -66,6 +66,7 @@
.then(response => {
this.setToken({token: response.data.token})
this.setUser({username: this.form.username})
this.$router.push('/')
})
.catch(error => {
console.log(error)

View File

@ -117,7 +117,10 @@
email: this.form.email,
password: this.form.password
})
.then(response => console.log(response.data))
.then(response => {
console.log(response.data);
this.$router.push('/signin')
})
.catch(error => {
if (error.response && error.response.status === 409)
this.exists = true