Show visual feedback on login error, redirect on success
This commit is contained in:
parent
ccbfc64bfc
commit
a6b6fe95c0
3 changed files with 53 additions and 32 deletions
|
@ -1,13 +1,17 @@
|
|||
const LoginForm = {
|
||||
data: () => ({
|
||||
user: {}
|
||||
user: {},
|
||||
authError: false
|
||||
}),
|
||||
computed: {
|
||||
loggingIn () { return this.$store.state.users.loggingIn }
|
||||
},
|
||||
methods: {
|
||||
submit () {
|
||||
this.$store.dispatch('loginUser', this.user)
|
||||
this.$store.dispatch('loginUser', this.user).then(
|
||||
() => { this.$router.push('/main/friends')},
|
||||
() => { this.authError = true }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue