Skip to content

Commit

Permalink
Get to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecDusheck committed Dec 22, 2018
1 parent c381ed7 commit 678f839
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/app/controllers/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {PasswordValidation} from "../../core/password-validation";
import {TokenPayload} from "../../core/models/token-payload";
import {AuthenticationService} from "../../core/services/authentication.service";
import {ActivatedRoute, Router} from "@angular/router";
import {PasswordStrength} from '../../core/password-strength';

@Component({
selector: 'app-register',
Expand Down
6 changes: 2 additions & 4 deletions src/app/core/password-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import * as zxcvbn from 'zxcvbn';
export class PasswordValidation {
static MatchPassword(AC: AbstractControl) {
const password = AC.get('password').value; // to get value in input tag
const confirmPassword = AC.get('confirmPassword').value; // to get value in input tag
if(password != confirmPassword) {
if(password != AC.get('confirmPassword').value) {
AC.get('confirmPassword').setErrors( {MatchPassword: true} )
}

const passResults = zxcvbn(password);
if(passResults.score < 2){
if(zxcvbn(password).score < 2){
AC.get('password').setErrors( {PassTooWeak: true} )
}
return null;
Expand Down

0 comments on commit 678f839

Please sign in to comment.