feat(profile): add updateProfile method and enhance password validation in register form
This commit is contained in:
@@ -55,7 +55,11 @@ export class RegisterPageComponent {
|
||||
'',
|
||||
[Validators.required, Validators.email, Validators.maxLength(TEXT_MAX_LENGTH)]
|
||||
],
|
||||
password: ['', [Validators.required, Validators.minLength(PASSWORD_MIN_LENGTH)]],
|
||||
password: ['', [
|
||||
Validators.required,
|
||||
Validators.minLength(PASSWORD_MIN_LENGTH),
|
||||
Validators.pattern(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).+$/)
|
||||
]],
|
||||
password_confirmation: ['', [Validators.required]]
|
||||
}, {
|
||||
validators: [passwordsMatchValidator]
|
||||
@@ -142,6 +146,10 @@ export class RegisterPageComponent {
|
||||
return `Debe tener al menos ${PASSWORD_MIN_LENGTH} caracteres.`;
|
||||
}
|
||||
|
||||
if (controlName === 'password' && control.hasError('pattern')) {
|
||||
return 'Debe contener mayuscula, minuscula y un caracter especial.';
|
||||
}
|
||||
|
||||
if (controlName === 'password_confirmation' && this.form.hasError('passwordMismatch')) {
|
||||
return 'Las contrasenas no coinciden.';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user