diff --git a/client/src/app/pages/auth/register/register.component.ts b/client/src/app/pages/auth/register/register.component.ts index ec7e16e..70eaefa 100644 --- a/client/src/app/pages/auth/register/register.component.ts +++ b/client/src/app/pages/auth/register/register.component.ts @@ -56,6 +56,11 @@ export class RegisterComponent implements OnDestroy { isSubmitted = false; isLoading = false; + private readonly passwordPattern: RegExp = new RegExp( + '^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\p{P}\\p{S}]).{8,}$', + 'u' + ); + private readonly router: Router = inject(Router); private readonly authService: AuthService = inject(AuthService); @@ -90,14 +95,14 @@ export class RegisterComponent implements OnDestroy { password: ['', [ Validators.required, Validators.minLength(8), - Validators.maxLength(20), - Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$') + Validators.maxLength(50), + Validators.pattern(this.passwordPattern) ]], confirmPassword: ['', [ Validators.required, Validators.minLength(8), - Validators.maxLength(20), - Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$') + Validators.maxLength(50), + Validators.pattern(this.passwordPattern) ]], termsAndConditions: [false, Validators.requiredTrue] }, {validators: this.passwordMatchValidator});