1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

[PM-3586] Fix short MP not showing minLength (#6086)

* Fix short MP not showing minLength

Added path to include the mininum password length defined as const in our Utils

* Introduce previousMinimumPasswordLength and use a minLength for MP

* Rename previousMinimumPasswordLength to originalMinimumPasswordLength
This commit is contained in:
Daniel James Smith
2023-09-06 16:12:14 +02:00
committed by GitHub
parent 864818c2d3
commit e8a5c5b337
2 changed files with 7 additions and 1 deletions

View File

@@ -42,7 +42,10 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
formGroup = this.formBuilder.group({
email: ["", [Validators.required, Validators.email]],
masterPassword: ["", [Validators.required, Validators.minLength(8)]],
masterPassword: [
"",
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],
],
rememberEmail: [false],
});
@@ -278,6 +281,8 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
switch (error.errorName) {
case "email":
return this.i18nService.t("invalidEmail");
case "minlength":
return this.i18nService.t("masterPasswordMinlength", Utils.originalMinimumPasswordLength);
default:
return this.i18nService.t(this.errorTag(error));
}