From c2aad870116b940cc9cfa93704498859e31bc082 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Wed, 13 Nov 2019 17:41:59 +0900 Subject: [PATCH] Enable to show login error message --- .../components/organisms/auth/LoginForm.vue | 20 ++++++++++++++++--- frontend/store/auth.js | 1 - 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/frontend/components/organisms/auth/LoginForm.vue b/frontend/components/organisms/auth/LoginForm.vue index 02e416c0..425ca291 100644 --- a/frontend/components/organisms/auth/LoginForm.vue +++ b/frontend/components/organisms/auth/LoginForm.vue @@ -10,14 +10,23 @@ ref="form" v-model="valid" > + + Incorrect username or password. + @@ -54,7 +64,8 @@ export default { username: '', password: '', userNameRules, - passwordRules + passwordRules, + showError: false } }, @@ -71,6 +82,9 @@ export default { .then((result) => { this.$router.push('/projects') }) + .catch(() => { + this.showError = true + }) } } } diff --git a/frontend/store/auth.js b/frontend/store/auth.js index 4de7b5ad..cd579e31 100644 --- a/frontend/store/auth.js +++ b/frontend/store/auth.js @@ -30,7 +30,6 @@ export const actions = { Cookie.set('jwt', result.data.token) ApiService.setHeader(result.data.token) }) - .catch(e => alert(e)) }, initAuth({ commit, dispatch }, req) { let token