aboutsummaryrefslogtreecommitdiff
path: root/src/components/login_form
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/login_form')
-rw-r--r--src/components/login_form/login_form.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js
index fb6dc651..dc917e47 100644
--- a/src/components/login_form/login_form.js
+++ b/src/components/login_form/login_form.js
@@ -31,15 +31,19 @@ const LoginForm = {
username: this.user.username,
password: this.user.password
}
- ).then((result) => {
+ ).then(async (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'})
+ try {
+ await this.$store.dispatch('loginUser', result.access_token)
+ this.$router.push({name: 'friends'})
+ } catch (e) {
+ console.log(e)
+ }
})
})
},