Notify password changes #1588

This commit is contained in:
Joan Sanchez 2019-07-11 07:06:53 +02:00
parent b29dd291ab
commit 8a5e0c5402
2 changed files with 8 additions and 3 deletions

View File

@ -44,16 +44,19 @@ export default class Controller {
if (response == 'ACCEPT') { if (response == 'ACCEPT') {
try { try {
if (!this.newPassword) if (!this.newPassword)
throw new Error(`Passwords can't be empty`); throw new Error(`You must enter a new password`);
if (this.newPassword != this.repeatPassword) if (this.newPassword != this.repeatPassword)
throw new Error(`Passwords don't match`); throw new Error(`Passwords don't match`);
let account = { let account = {
password: this.newPassword password: this.newPassword
}; };
this.$http.patch(`/client/api/Accounts/${this.client.id}`, account); this.$http.patch(`/client/api/Accounts/${this.client.id}`, account).then(res => {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
});
} catch (e) { } catch (e) {
this.vnApp.showError(this.$translate.instant(e.message)); this.vnApp.showError(this.$translate.instant(e.message));
return false; return false;
} }
} }

View File

@ -2,4 +2,6 @@ User: Usuario
Enable web access: Habilitar acceso web Enable web access: Habilitar acceso web
New password: Nueva contraseña New password: Nueva contraseña
Repeat password: Repetir contraseña Repeat password: Repetir contraseña
Change password: Cambiar contraseña Change password: Cambiar contraseña
Passwords don't match: Las contraseñas no coinciden
You must enter a new password: Debes introducir una nueva contraseña