fix : redirect after change password

This commit is contained in:
zeinab.ashrafi
2025-05-07 14:26:33 +03:30
parent ae28fe2042
commit 4a15071d17
2 changed files with 7 additions and 5 deletions
+2 -4
View File
@@ -12,7 +12,7 @@
v-model="form.code" v-model="form.code"
label="Verify Code Number" label="Verify Code Number"
color="black" color="black"
></v-text-field> />
</v-flex> </v-flex>
</v-layout> </v-layout>
<v-layout row wrap class="px-3"> <v-layout row wrap class="px-3">
@@ -40,9 +40,7 @@ export default {
}; };
}, },
methods: { methods: {
...mapActions('auth', [ ...mapActions('auth', ['verifyCodeSMS']),
'verifyCodeSMS'
]),
submitVerifyCode() { submitVerifyCode() {
if (this.form.code != '') { if (this.form.code != '') {
this.verifyCodeSMS({form: this.form}); this.verifyCodeSMS({form: this.form});
+5 -1
View File
@@ -50,7 +50,11 @@ export default {
var response = await ApiService.post(urls.changePassword, form); var response = await ApiService.post(urls.changePassword, form);
if(response && response.status == 200 ) { if(response && response.status == 200 ) {
commit('modal/closeModal', {}, {root: true}); commit('modal/closeModal', {}, {root: true});
router.push({ name: `Dashboard` }); // router.push({ name: `Dashboard` });
const redirectPath = router.history.current.query.redirect || '/';
if (router.currentRoute.path !== redirectPath) {
router.push(redirectPath);
}
} }
}, },