diff --git a/front/salix/components/recover-password/index.js b/front/salix/components/recover-password/index.js index a982daba7b..ea52192bc3 100644 --- a/front/salix/components/recover-password/index.js +++ b/front/salix/components/recover-password/index.js @@ -33,6 +33,9 @@ export default class Controller { 'email': { url: 'VnUsers/recoverPassword', data: {user: this.user}, + cb: data => { + data === '' && this.goToLogin(); + } }, 'sms': { @@ -43,7 +46,7 @@ export default class Controller { data.token && this.goToChangePassword(data); !data.token && this.goToLogin(); } else - data.code && this.handleCode(data.code); + this.handleCode(data.code); } }, }; @@ -54,7 +57,7 @@ export default class Controller { throw new UserError(`Credentials not valid`); const method = this.methodsAvailables()[this.method]; this.$http.post(method.url, method.data) - .then(({data}) => data === '' ? this.goToLogin() : method.cb(data)); + .then(({data}) => method.cb(data)); } } Controller.$inject = ['$scope', '$element', '$http', 'vnApp', '$translate', '$state', '$location']; diff --git a/front/salix/components/recover-password/locale/es.yml b/front/salix/components/recover-password/locale/es.yml index e8d1b4d578..f8c8268b52 100644 --- a/front/salix/components/recover-password/locale/es.yml +++ b/front/salix/components/recover-password/locale/es.yml @@ -6,3 +6,4 @@ User or recovery email: Usuario User's phone: Móvil del usuario User's id: Id del usuario Credentials not valid: Credenciales no válidas +E-mail: Correo electrónico