fix(preferences(js)): show error when passwords don't match

This commit is contained in:
Francis Lachapelle
2020-07-27 10:20:38 -04:00
parent 2300fe8aab
commit 0e7ce3129c
3 changed files with 13 additions and 4 deletions
@@ -462,7 +462,13 @@
return $q.reject('Invalid form');
};
this.canChangePassword = function() {
this.canChangePassword = function(form) {
if (this.passwords.newPasswordConfirmation && this.passwords.newPasswordConfirmation.length &&
this.passwords.newPassword != this.passwords.newPasswordConfirmation) {
form.newPasswordConfirmation.$setValidity('newPasswordMismatch', false);
} else {
form.newPasswordConfirmation.$setValidity('newPasswordMismatch', true);
}
if (this.passwords.newPassword && this.passwords.newPassword.length > 0 &&
this.passwords.newPasswordConfirmation && this.passwords.newPasswordConfirmation.length &&
this.passwords.newPassword == this.passwords.newPasswordConfirmation &&