Notify password changes #1588
This commit is contained in:
parent
b29dd291ab
commit
8a5e0c5402
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue