Commit f57f8005 authored by Pieterjan Vanhoof's avatar Pieterjan Vanhoof Committed by GitHub

Merge pull request #294 from stratisproject/ui

Fix password validation
parents 1c6a03c4 db5256ca
...@@ -8,17 +8,14 @@ export class PasswordValidationDirective { ...@@ -8,17 +8,14 @@ export class PasswordValidationDirective {
constructor() { } constructor() { }
static MatchPassword(AC: AbstractControl) { static MatchPassword(AC: AbstractControl) {
AC.get('walletPassword').valueChanges.subscribe(() => {
AC.get('walletPasswordConfirmation').updateValueAndValidity();
});
let password = AC.get('walletPassword').value; let password = AC.get('walletPassword').value;
let confirmPassword = AC.get('walletPasswordConfirmation').value; let confirmPassword = AC.get('walletPasswordConfirmation').value;
if(password != confirmPassword) { if(confirmPassword !== password) {
AC.get('walletPasswordConfirmation').setErrors({ walletPasswordConfirmation: true }); AC.get('walletPasswordConfirmation').setErrors({ walletPasswordConfirmation: true });
} else { } 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