Browse Source

Enable to show login error message

pull/341/head
Hironsan 5 years ago
parent
commit
c2aad87011
2 changed files with 17 additions and 4 deletions
  1. 20
      frontend/components/organisms/auth/LoginForm.vue
  2. 1
      frontend/store/auth.js

20
frontend/components/organisms/auth/LoginForm.vue

@ -10,14 +10,23 @@
ref="form"
v-model="valid"
>
<v-alert
v-show="showError"
v-model="showError"
type="error"
dismissible
>
Incorrect username or password.
</v-alert>
<v-text-field
v-model="username"
:rules="userNameRules"
label="Login"
name="login"
label="Username"
name="username"
prepend-icon="person"
type="text"
autofocus
@keyup.enter="tryLogin"
/>
<v-text-field
id="password"
@ -27,6 +36,7 @@
name="password"
prepend-icon="lock"
type="password"
@keyup.enter="tryLogin"
/>
</v-form>
</template>
@ -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
})
}
}
}

1
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

Loading…
Cancel
Save