99 <form @submit =" onSubmit" >
1010 <div class =" form-group" >
1111 <label for =" email" >Email</label >
12- <input type =" email"
13- class =" form-control"
14- id =" email"
15- aria-describedby =" emailHelp"
16- placeholder =" Insert your email"
17- v-model =" email"
18- required >
12+ <input
13+ type =" email"
14+ class =" form-control"
15+ id =" email"
16+ aria-describedby =" emailHelp"
17+ placeholder =" Insert your email"
18+ v-model =" email"
19+ required >
1920 </div >
2021 <div class =" form-group" >
2122 <label for =" senha" >Password</label >
22- <input type =" password"
23- class =" form-control"
24- id =" senha"
25- placeholder =" Insert your password"
26- v-model =" password"
27- required >
23+ <input
24+ type =" password"
25+ class =" form-control"
26+ id =" senha"
27+ placeholder =" Insert your password"
28+ v-model =" password"
29+ required >
2830 </div >
29- <div class =" alert alert-danger"
30- role =" alert"
31- v-if =" error" >\{{error.message}}</div >
31+ <div
32+ class =" alert alert-danger"
33+ role =" alert"
34+ v-if =" error" >\{{ error.message }}</div >
3235 <div class =" flex" >
33- <a class =" link"
36+ <a
37+ class =" link"
3438 @click.prevent =" $refs.forgotPassword.show()"
3539 href =" #" >
3640 Forgot your password?
3741 </a >
38- <button type =" submit"
39- class =" btn btn-success" >
40- <i v-if =" loading" class =" fa fa-spinner" ></i >
41- <i v-else class =" fa fa-check" ></i >
42+ <button
43+ type =" submit"
44+ class =" btn btn-success" >
45+ <i
46+ v-if =" loading"
47+ class =" fa fa-spinner" />
48+ <i
49+ v-else
50+ class =" fa fa-check" />
4251 SIGN IN
4352 </button >
4453 </div >
4554 </form >
4655
4756 <!-- Forgot Password -->
4857 <b-modal
49- ref =" forgotPassword"
50- title =" Recover the password"
51- size =" sm"
52- @ok =" onModalOk"
53- @shown =" onModalShown" >
54- <form ref =" forgotPasswordForm" class =" forgot-form" >
55- <i v-if =" loading" class =" fa fa-spinner" ></i >
58+ ref =" forgotPassword"
59+ title =" Recover the password"
60+ size =" sm"
61+ @ok =" onModalOk"
62+ @shown =" onModalShown" >
63+ <form
64+ ref =" forgotPasswordForm"
65+ class =" forgot-form" >
66+ <i
67+ v-if =" loading"
68+ class =" fa fa-spinner" />
5669 <b-alert
5770 v-if =" recoverError"
5871 :show =" recoverError !== null"
6679 placeholder =" Insert your email"
6780 v-model =" recoverEmail"
6881 @keydown.enter =" sendRecoverEmail"
69- required / >
82+ required >
7083 </form >
7184 </b-modal >
7285
8295
8396<script >
8497export default {
85- data () {
98+ data () {
8699 return {
87100 email: null ,
88101 password: null ,
89102 error: null ,
90103 recoverError: null ,
91104 recoverSuccess: null ,
92105 recoverEmail: null ,
93- loading: false
94- }
106+ loading: false ,
107+ };
95108 },
96109 methods: {
97- onSubmit (evt ) {
98- evt .preventDefault ()
99- this .loading = true
100- this .error = null
110+ onSubmit (evt ) {
111+ evt .preventDefault ();
112+ this .loading = true ;
113+ this .error = null ;
101114 this
102115 .$store
103116 .dispatch (' auth/signIn' , {
104117 email: this .email ,
105- password: this .password
118+ password: this .password ,
106119 })
107120 .then (() => {
108- this .loading = false
109- })
110- .catch (err => {
111- this .error = err
112- this .loading = false
121+ this .loading = false ;
113122 })
123+ .catch ((err ) => {
124+ this .error = err;
125+ this .loading = false ;
126+ });
114127 },
115128 onModalShown () {
116129 this .$refs .forgotPasswordForm .reset ();
@@ -136,16 +149,16 @@ export default {
136149 this .$refs .forgotPassword .hide ();
137150 this .$refs .recoverSuccess .show ();
138151 })
139- .catch (err => {
152+ .catch (( err ) => {
140153 this .loading = false ;
141154 this .recoverError = err;
142155 });
143156 } else {
144157 this .recoverError = {message: ' Please, check the inserted email and try again' };
145158 }
146- }
147- }
148- }
159+ },
160+ },
161+ };
149162 </script >
150163
151164<style lang="scss" scoped>
0 commit comments