File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
components/organisms/auth Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 10
10
ref =" form"
11
11
v-model =" valid"
12
12
>
13
+ <v-alert
14
+ v-show =" showError"
15
+ v-model =" showError"
16
+ type =" error"
17
+ dismissible
18
+ >
19
+ Incorrect username or password.
20
+ </v-alert >
13
21
<v-text-field
14
22
v-model =" username"
15
23
:rules =" userNameRules"
16
- label =" Login "
17
- name =" login "
24
+ label =" Username "
25
+ name =" username "
18
26
prepend-icon =" person"
19
27
type =" text"
20
28
autofocus
29
+ @keyup.enter =" tryLogin"
21
30
/>
22
31
<v-text-field
23
32
id =" password"
27
36
name =" password"
28
37
prepend-icon =" lock"
29
38
type =" password"
39
+ @keyup.enter =" tryLogin"
30
40
/>
31
41
</v-form >
32
42
</template >
@@ -54,7 +64,8 @@ export default {
54
64
username: ' ' ,
55
65
password: ' ' ,
56
66
userNameRules,
57
- passwordRules
67
+ passwordRules,
68
+ showError: false
58
69
}
59
70
},
60
71
@@ -71,6 +82,9 @@ export default {
71
82
.then ((result ) => {
72
83
this .$router .push (' /projects' )
73
84
})
85
+ .catch (() => {
86
+ this .showError = true
87
+ })
74
88
}
75
89
}
76
90
}
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ export const actions = {
30
30
Cookie . set ( 'jwt' , result . data . token )
31
31
ApiService . setHeader ( result . data . token )
32
32
} )
33
- . catch ( e => alert ( e ) )
34
33
} ,
35
34
initAuth ( { commit, dispatch } , req ) {
36
35
let token
You can’t perform that action at this time.
0 commit comments