File tree 2 files changed +10
-6
lines changed 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ export default {
135
135
return {
136
136
certificate: null ,
137
137
resume: null ,
138
+ user_email: null ,
138
139
};
139
140
},
140
141
computed: {
@@ -154,10 +155,6 @@ export default {
154
155
}
155
156
},
156
157
157
- user_email () {
158
- const { currentUser } = firebase .auth ();
159
- if (currentUser) return currentUser .email ;
160
- },
161
158
162
159
routerLocation () {
163
160
return {
@@ -189,6 +186,11 @@ export default {
189
186
.catch (e => {
190
187
this .resume = null ;
191
188
});
189
+ firebase .auth ().onAuthStateChanged ((user ) => {
190
+ if (user) {
191
+ this .user_email = user .email ;
192
+ }
193
+ })
192
194
},
193
195
methods: {
194
196
clickToCopy () {
Original file line number Diff line number Diff line change @@ -78,15 +78,17 @@ export default {
78
78
methods: {
79
79
submitForm () {
80
80
var user = firebase .auth ().currentUser ;
81
+ const credential = firebase .auth .EmailAuthProvider .credential (user .email , this .currentPasswd );
81
82
user
82
- .reauthenticateAndRetrieveDataWithCredential (this . currentPasswd )
83
+ .reauthenticateAndRetrieveDataWithCredential (credential )
83
84
.then (_ => {
84
85
user
85
- .updatePassword (this .newPassword )
86
+ .updatePassword (this .newPasswd )
86
87
.then (_ => {
87
88
this .$toasted .global .success ({
88
89
message: ` Successfully updated password!`
89
90
});
91
+ this .$router .push ({ name: " ~/dashboard" });
90
92
})
91
93
.catch (err => {
92
94
this .$toasted .global .error_post ({ message: err .message });
You can’t perform that action at this time.
0 commit comments