Commit db5256ca authored by dev0tion's avatar dev0tion

Fix password validation

parent 3576980d
......@@ -8,17 +8,14 @@ export class PasswordValidationDirective {
constructor() { }
static MatchPassword(AC: AbstractControl) {
AC.get('walletPassword').valueChanges.subscribe(() => {
AC.get('walletPasswordConfirmation').updateValueAndValidity();
});
let password = AC.get('walletPassword').value;
let confirmPassword = AC.get('walletPasswordConfirmation').value;
if(password != confirmPassword) {
if(confirmPassword !== password) {
AC.get('walletPasswordConfirmation').setErrors({ walletPasswordConfirmation: true });
} else {
return null
AC.get('walletPasswordConfirmation').setErrors(null);
return null;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment