diff --git a/apps/web/src/app/admin-console/organizations/policies/password-generator.component.html b/apps/web/src/app/admin-console/organizations/policies/password-generator.component.html index 350f7da7b4..80df5fa2e6 100644 --- a/apps/web/src/app/admin-console/organizations/policies/password-generator.component.html +++ b/apps/web/src/app/admin-console/organizations/policies/password-generator.component.html @@ -1,144 +1,64 @@
-
-
- - -
+ + + {{ "turnOn" | i18n }} + + +
+ + {{ "defaultType" | i18n }} + + + +
-
-
- - -
+

{{ "password" | i18n }}

+
+ + {{ "minLength" | i18n }} + +
-

{{ "password" | i18n }}

-
-
- - -
+
+ + {{ "minNumbers" | i18n }} + + + + {{ "minSpecial" | i18n }} + +
-
-
- - -
-
- - -
-
-
- - -
-
- - -
-
- - -
-
- - -
-

{{ "passphrase" | i18n }}

-
-
- - -
-
-
- - -
-
- - + + + A-Z + + + + a-z + + + + 0-9 + + + + !@#$%^&* + +

{{ "passphrase" | i18n }}

+
+ + {{ "minimumNumberOfWords" | i18n }} + +
+ + + {{ "capitalize" | i18n }} + + + + {{ "includeNumber" | i18n }} +
diff --git a/apps/web/src/app/admin-console/organizations/policies/password-generator.component.ts b/apps/web/src/app/admin-console/organizations/policies/password-generator.component.ts index 464586d685..93124c42fa 100644 --- a/apps/web/src/app/admin-console/organizations/policies/password-generator.component.ts +++ b/apps/web/src/app/admin-console/organizations/policies/password-generator.component.ts @@ -1,5 +1,5 @@ import { Component } from "@angular/core"; -import { UntypedFormBuilder } from "@angular/forms"; +import { UntypedFormBuilder, Validators } from "@angular/forms"; import { PolicyType } from "@bitwarden/common/admin-console/enums"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; @@ -20,14 +20,14 @@ export class PasswordGeneratorPolicy extends BasePolicy { export class PasswordGeneratorPolicyComponent extends BasePolicyComponent { data = this.formBuilder.group({ defaultType: [null], - minLength: [null], + minLength: [null, [Validators.min(5), Validators.max(128)]], useUpper: [null], useLower: [null], useNumbers: [null], useSpecial: [null], - minNumbers: [null], - minSpecial: [null], - minNumberWords: [null], + minNumbers: [null, [Validators.min(0), Validators.max(9)]], + minSpecial: [null, [Validators.min(0), Validators.max(9)]], + minNumberWords: [null, [Validators.min(3), Validators.max(20)]], capitalize: [null], includeNumber: [null], });