From 55b38a3f6e2a126362fdc58e93c6a9acdbf045f5 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Sat, 24 Feb 2018 14:28:48 +0100 Subject: [PATCH] Fixed broken error handling on user login and settings --- front/src/components/auth/Login.vue | 6 +++--- front/src/components/auth/Settings.vue | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/front/src/components/auth/Login.vue b/front/src/components/auth/Login.vue index b02a3ed07..f84ad9295 100644 --- a/front/src/components/auth/Login.vue +++ b/front/src/components/auth/Login.vue @@ -73,9 +73,9 @@ export default { // to properly make use of http in the auth service this.$store.dispatch('auth/login', { credentials, - next: this.next, - onError: response => { - if (response.status === 400) { + next: '/library', + onError: error => { + if (error.response.status === 400) { self.error = 'invalid_credentials' } else { self.error = 'unknown_error' diff --git a/front/src/components/auth/Settings.vue b/front/src/components/auth/Settings.vue index f090581ef..4e8f33289 100644 --- a/front/src/components/auth/Settings.vue +++ b/front/src/components/auth/Settings.vue @@ -37,7 +37,6 @@