diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index db914c5c52b546e65870dd5c4d0baa4a6d774d16..c73fc809faecfbe88e86a964e972197e473ed8be 100644 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -72,12 +72,17 @@ export default { submit () { this.loading = true Auth.getJWT(this.credentials).then(() => { - Auth.getUser().then(() => { - this.$router.push({ name: 'home' }) - }) - Auth.getJWTTimeDelta() + return Promise.all([ + Auth.getUser(), + Auth.getJWTTimeDelta() + ]) + }).then(() => { + this.$router.push({ name: 'home' }) this.loading = false - }).catch(() => { this.loading = false }) + }).catch((er) => { + Auth.SET_MESSAGE("Login failed. Please try again.") + this.loading = false + }) }, registered (credentials) { this.registerDialog = false