refactor: align ui and backend password validation policy
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
2b730bb1ea
commit
0762dfbac2
+3
-3
@@ -70,7 +70,7 @@
|
||||
{{ 'labels.inputs.Password' | translate }} <strong>{{'labels.commons.is required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.password.hasError('minlength')">
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.8 characters long' | translate }}</strong>
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.12 characters long' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.password.hasError('maxlength')">
|
||||
{{'labels.commons.Password should not be more than' | translate }}
|
||||
@@ -79,7 +79,7 @@
|
||||
<mat-error
|
||||
*ngIf="createSelfServiceForm.controls.password.hasError('pattern') && !(createSelfServiceForm.controls.password.hasError('minlength') || createSelfServiceForm.controls.password.hasError('maxlength'))">
|
||||
{{'labels.commons.Password should include a' | translate }}
|
||||
<strong>{{'labels.commons.numeral' | translate }}</strong> {{'labels.commons.and at' | translate }}
|
||||
<strong>{{'labels.commons.numeral' | translate }}</strong> {{'labels.commons.and at' | translate }}
|
||||
<strong>{{'labels.commons.least one uppercase' | translate }}</strong>
|
||||
,<strong>{{'labels.commons.lowercase and special character' | translate }}</strong>
|
||||
</mat-error>
|
||||
@@ -120,4 +120,4 @@
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Subscription } from 'rxjs';
|
||||
|
||||
export class PasswordsUtility {
|
||||
// password regex pattern
|
||||
public static PASSWORD_REGEX = '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*[#$@$!%*?&])[A-Za-z\d#$@$!%*?&].{8,}$';
|
||||
public static PASSWORD_REGEX = '^(?!.*(.)\\1)(?!.*\\s)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\\w\\s]).{12,50}$';
|
||||
|
||||
public getPasswordValidators(): ValidatorFn[] {
|
||||
return [Validators.required, Validators.pattern(PasswordsUtility.PASSWORD_REGEX), Validators.maxLength(50), Validators.minLength(8)];
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{{ 'labels.inputs.Password' | translate }} <strong>{{'labels.commons.is required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="resetPasswordForm.controls.password.hasError('minlength')">
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.8 characters long' | translate }}</strong>
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.12 characters long' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="resetPasswordForm.controls.password.hasError('maxlength')">
|
||||
{{'labels.commons.Password should not be more than' | translate }} <strong>{{'labels.commons.50 characters long' | translate }}</strong>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{ 'labels.inputs.Password' | translate }} <strong>{{'labels.commons.is required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="changePasswordForm.controls.password.hasError('minlength')">
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.8 characters long' | translate }}</strong>
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.12 characters long' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="changePasswordForm.controls.password.hasError('maxlength')">
|
||||
{{'labels.commons.Password should not be more than' | translate }} <strong>{{'labels.commons.50 characters long' | translate }}</strong>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
{{'labels.inputs.Password' | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="userForm.controls.password.hasError('minlength')">
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.8 characters long' | translate }}</strong>
|
||||
{{'labels.commons.Password should be at least' | translate }} <strong>{{'labels.commons.12 characters long' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="userForm.controls.password.hasError('maxlength')">
|
||||
{{'labels.commons.Password should not be more than' | translate }} <strong>{{'labels.commons.50 characters long' | translate }}</strong>
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 znaků dlouhé",
|
||||
"8 characters long": "8 znaků dlouhé",
|
||||
"12 characters long": "12 znaků dlouhé",
|
||||
"Amount must be": "Částka musí být",
|
||||
"At least one restricted product": "Alespoň jeden omezený produkt",
|
||||
"At least one role": "Alespoň jednu roli",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 Zeichen lang",
|
||||
"8 characters long": "8 Zeichen lang",
|
||||
"12 characters long": "12 Zeichen lang",
|
||||
"Amount must be": "Betrag muss sein",
|
||||
"At least one restricted product": "Mindestens ein eingeschränktes Produkt",
|
||||
"At least one role": "Mindestens eine Rolle",
|
||||
|
||||
@@ -743,7 +743,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 characters long",
|
||||
"8 characters long": "8 characters long",
|
||||
"12 characters long": "12 characters long",
|
||||
"Amount must be": "Amount must be",
|
||||
"At least one restricted product": "At least one restricted product",
|
||||
"At least one role": "At least one role",
|
||||
|
||||
@@ -739,7 +739,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 caracteres de largo",
|
||||
"8 characters long": "8 caracteres de largo",
|
||||
"12 characters long": "12 caracteres de largo",
|
||||
"Amount must be": "La cantidad debe ser",
|
||||
"At least one restricted product": "Al menos un producto restringido",
|
||||
"At least one role": "Al menos un rol",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 caractères",
|
||||
"8 characters long": "8 caractères",
|
||||
"12 characters long": "12 caractères",
|
||||
"Amount must be": "Le montant doit être",
|
||||
"At least one restricted product": "Au moins un produit restreint",
|
||||
"At least one role": "Au moins un rôle",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 caratteri di lunghezza",
|
||||
"8 characters long": "8 caratteri di lunghezza",
|
||||
"12 characters long": "12 caratteri di lunghezza",
|
||||
"Amount must be": "L'importo deve essere",
|
||||
"At least one restricted product": "Almeno un prodotto limitato",
|
||||
"At least one role": "Almeno un ruolo",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50자(영문 기준)",
|
||||
"8 characters long": "8자 길이",
|
||||
"12 characters long": "12자 길이",
|
||||
"Amount must be": "금액은 다음과 같아야 합니다.",
|
||||
"At least one restricted product": "하나 이상의 제한된 제품",
|
||||
"At least one role": "역할이 하나 이상",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 simbolių ilgio",
|
||||
"8 characters long": "8 simbolių ilgio",
|
||||
"12 characters long": "12 simbolių ilgio",
|
||||
"Amount must be": "Suma turi būti",
|
||||
"At least one restricted product": "Bent vienas ribojamas produktas",
|
||||
"At least one role": "Bent vienas vaidmuo",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 rakstzīmes garš",
|
||||
"8 characters long": "8 rakstzīmes garš",
|
||||
"12 characters long": "12 rakstzīmes garš",
|
||||
"Amount must be": "Summai jābūt",
|
||||
"At least one restricted product": "Vismaz viens ierobežots produkts",
|
||||
"At least one role": "Vismaz viena loma",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "५० वर्ण लामो",
|
||||
"8 characters long": "8 वर्ण लामो",
|
||||
"12 characters long": "12 वर्ण लामो",
|
||||
"Amount must be": "रकम हुनुपर्छ",
|
||||
"At least one restricted product": "कम्तिमा एक प्रतिबन्धित उत्पादन",
|
||||
"At least one role": "कम्तिमा एक भूमिका",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "50 caracteres",
|
||||
"8 characters long": "8 caracteres de comprimento",
|
||||
"12 characters long": "12 caracteres de comprimento",
|
||||
"Amount must be": "O valor deve ser",
|
||||
"At least one restricted product": "Pelo menos um produto restrito",
|
||||
"At least one role": "Pelo menos um papel",
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
},
|
||||
"commons": {
|
||||
"50 characters long": "Urefu wa herufi 50",
|
||||
"8 characters long": "Urefu wa herufi 8",
|
||||
"12 characters long": "Urefu wa herufi 12",
|
||||
"Amount must be": "Kiasi lazima kiwe",
|
||||
"At least one restricted product": "Angalau bidhaa moja iliyozuiliwa",
|
||||
"At least one role": "Angalau jukumu moja",
|
||||
|
||||
Reference in New Issue
Block a user