From b7f39b45ab4897c75427db7f1c9de81dc9643c59 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 26 Mar 2024 08:20:04 +0100 Subject: [PATCH] refs #6427 feat: front updates --- front/salix/components/recover-password/index.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/front/salix/components/recover-password/index.js b/front/salix/components/recover-password/index.js index 723dd47c1..9ddf7bc21 100644 --- a/front/salix/components/recover-password/index.js +++ b/front/salix/components/recover-password/index.js @@ -18,19 +18,13 @@ export default class Controller { $scope.$ctrl.sms = isSms; }); } - // ONLY FOR TESTS - // $onInit() { - // this.$scope.$ctrl.sms = true; - // this.$scope.$ctrl.userId = '9'; - // this.$scope.$ctrl.user = '432978106'; - // } goToLogin() { this.vnApp.showSuccess(this.$translate.instant('Notification sent!')); this.$state.go('login'); } - goToChangePassword({valid: isValid, token}) { - if (!isValid) + goToChangePassword({token}) { + if (!token) this.vnApp.showError(this.$translate.instant('Invalid login')); else { this.$state.params.userId = this.userId; @@ -40,7 +34,7 @@ export default class Controller { goToOTP(otp) { this.otp = true; this.$state.params.otp = otp; - this.code = otp; + this.code = null; } submit() { @@ -51,7 +45,7 @@ export default class Controller { this.$http.post('VnUsers/recoverPasswordSMS', {id: this.userId, phone: this.user, otp: this.code}) .then(({data}) => { data.otp && this.goToOTP(data.otp); - data.valid && this.goToChangePassword(data); + data.token && this.goToChangePassword(data); }); } else { this.$http.post('VnUsers/recoverPassword', {user: this.user})