Skip to content

Commit

Permalink
Merge pull request #294 from stratisproject/ui
Browse files Browse the repository at this point in the history
Fix password validation
  • Loading branch information
dev0tion authored Oct 21, 2017
2 parents 1c6a03c + db5256c commit f57f800
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit f57f800

Please sign in to comment.