Skip to content

Commit

Permalink
chore: improved password validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yosvelquintero committed Sep 13, 2023
1 parent ab50049 commit 2ac38ec
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
<vcl-hint-error error="required">This field is required.</vcl-hint-error>
<vcl-hint-error error="pattern">This field must: </vcl-hint-error>
<vcl-hint-error error="pattern"
>- have at least 6 characters in length</vcl-hint-error
>- have at least 6 characters length</vcl-hint-error
>
<vcl-hint-error error="pattern"
>- contain a lowercase letters</vcl-hint-error
>- contain a lowercase letter</vcl-hint-error
>
<vcl-hint-error error="pattern"
>- contain a uppercase letters</vcl-hint-error
>- contain a uppercase letter</vcl-hint-error
>
<vcl-hint-error error="pattern">- contain a number</vcl-hint-error>
<vcl-hint-error error="pattern"
Expand Down Expand Up @@ -89,8 +89,8 @@
<div class="row">
<div class="col">
<rc-submit-button
[isInvalid]="form.invalid"
[isLoading]="isLoading$ | async"
[isDisabled]="form.invalid"
[isBusy]="isLoading$ | async"
>Confirm password</rc-submit-button
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<div class="row">
<div class="col">
<rc-submit-button
[isInvalid]="!form.valid"
[isLoading]="isLoading$ | async"
[isDisabled]="form.invalid"
[isBusy]="isLoading$ | async"
>
Reset Password
</rc-submit-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@
/>
</vcl-password-input>
<vcl-hint-error error="required">This field is required.</vcl-hint-error>
<vcl-hint-error error="pattern">This field must: </vcl-hint-error>
<vcl-hint-error error="pattern"
>- have at least 6 characters length</vcl-hint-error
>
<vcl-hint-error error="pattern"
>- contain a lowercase letter</vcl-hint-error
>
<vcl-hint-error error="pattern"
>- contain a uppercase letter</vcl-hint-error
>
<vcl-hint-error error="pattern">- contain a number</vcl-hint-error>
<vcl-hint-error error="pattern"
>- contain a special character</vcl-hint-error
>
</vcl-form-control-group>
<div class="row justify-between">
<p>
Expand All @@ -58,8 +72,8 @@
</p>

<rc-submit-button
[isInvalid]="form.invalid"
[isLoading]="isLoading$ | async"
[isDisabled]="form.invalid"
[isBusy]="isLoading$ | async"
>
Sign In</rc-submit-button
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { FormBuilder, FormControl, Validators } from '@angular/forms';

import { ROUTER } from '@console-core/config';
import { REGEX, ROUTER } from '@console-core/config';
import { AuthnFacade } from '@console-core/state';

@Component({
Expand All @@ -12,7 +12,7 @@ export class RcSignInComponent {
ROUTER = ROUTER;
form = this.fb.group({
identifier: ['', [Validators.required]],
password: ['', [Validators.required]],
password: ['', [Validators.required, Validators.pattern(REGEX.password)]],
});
isLoading$ = this.authnFacade.isLoading$;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
<vcl-hint-error error="required">This field is required.</vcl-hint-error>
<vcl-hint-error error="pattern">This field must: </vcl-hint-error>
<vcl-hint-error error="pattern"
>- have at least 6 characters in length</vcl-hint-error
>- have at least 6 characters length</vcl-hint-error
>
<vcl-hint-error error="pattern"
>- contain a lowercase letters</vcl-hint-error
>- contain a lowercase letter</vcl-hint-error
>
<vcl-hint-error error="pattern"
>- contain a uppercase letters</vcl-hint-error
>- contain a uppercase letter</vcl-hint-error
>
<vcl-hint-error error="pattern">- contain a number</vcl-hint-error>
<vcl-hint-error error="pattern"
Expand Down Expand Up @@ -201,8 +201,8 @@
<div class="row">
<div class="col">
<rc-submit-button
[isInvalid]="form.invalid"
[isLoading]="isLoading$ | async"
[isDisabled]="form.invalid"
[isBusy]="isLoading$ | async"
>Sign Up</rc-submit-button
>
</div>
Expand Down

0 comments on commit 2ac38ec

Please sign in to comment.