Add back that login error thing that someone removed
This commit is contained in:
parent
3b1cafc19f
commit
1b76a5a9ea
4 changed files with 52 additions and 22 deletions
|
@ -22,6 +22,7 @@ const LoginForm = {
|
|||
oauth: this.$store.state.oauth,
|
||||
instance: this.$store.state.instance.server
|
||||
}
|
||||
this.clearError()
|
||||
oauthApi.getOrCreateApp(data).then((app) => {
|
||||
oauthApi.getTokenWithCredentials(
|
||||
{
|
||||
|
@ -30,11 +31,19 @@ const LoginForm = {
|
|||
username: this.user.username,
|
||||
password: this.user.password})
|
||||
.then((result) => {
|
||||
if (result.error) {
|
||||
this.authError = result.error
|
||||
this.user.password = ''
|
||||
return
|
||||
}
|
||||
this.$store.commit('setToken', result.access_token)
|
||||
this.$store.dispatch('loginUser', result.access_token)
|
||||
this.$router.push({name: 'friends'})
|
||||
})
|
||||
})
|
||||
},
|
||||
clearError () {
|
||||
this.authError = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue