Formatting
This commit is contained in:
parent
1b76a5a9ea
commit
4d3907b86a
2 changed files with 13 additions and 11 deletions
|
@ -29,17 +29,18 @@ const LoginForm = {
|
||||||
app,
|
app,
|
||||||
instance: data.instance,
|
instance: data.instance,
|
||||||
username: this.user.username,
|
username: this.user.username,
|
||||||
password: this.user.password})
|
password: this.user.password
|
||||||
.then((result) => {
|
}
|
||||||
if (result.error) {
|
).then((result) => {
|
||||||
this.authError = result.error
|
if (result.error) {
|
||||||
this.user.password = ''
|
this.authError = result.error
|
||||||
return
|
this.user.password = ''
|
||||||
}
|
return
|
||||||
this.$store.commit('setToken', result.access_token)
|
}
|
||||||
this.$store.dispatch('loginUser', result.access_token)
|
this.$store.commit('setToken', result.access_token)
|
||||||
this.$router.push({name: 'friends'})
|
this.$store.dispatch('loginUser', result.access_token)
|
||||||
})
|
this.$router.push({name: 'friends'})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
clearError () {
|
clearError () {
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div v-if="authError" class='form-group'>
|
<div v-if="authError" class='form-group'>
|
||||||
<div class='alert error'>
|
<div class='alert error'>
|
||||||
{{authError}}
|
{{authError}}
|
||||||
|
|
Loading…
Reference in a new issue