@ -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"
/>
id="password"
@ -27,6 +36,7 @@
name="password"
prepend-icon="lock"
type="password"
</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
@ -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