diff --git a/src/app/organizations/manage/policy-edit.component.html b/src/app/organizations/manage/policy-edit.component.html index a5f4024efd..5c8143e1fa 100644 --- a/src/app/organizations/manage/policy-edit.component.html +++ b/src/app/organizations/manage/policy-edit.component.html @@ -59,19 +59,19 @@
+ min="5" max="128" [(ngModel)]="passGenMinLength">
+ min="0" max="9" [(ngModel)]="passGenMinNumbers">
+ min="0" max="9" [(ngModel)]="passGenMinSpecial">
diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 3b5f729180..63394e5e87 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -113,7 +113,7 @@ const lockService = new LockService(cipherService, folderService, collectionServ const syncService = new SyncService(userService, apiService, settingsService, folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService, async (expired: boolean) => messagingService.send('logout', { expired: expired })); -const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService); +const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, policyService); const totpService = new TotpService(storageService, cryptoFunctionService); const containerService = new ContainerService(cryptoService); const authService = new AuthService(cryptoService, apiService, diff --git a/src/app/tools/password-generator.component.html b/src/app/tools/password-generator.component.html index 33aab74eb0..f77f748229 100644 --- a/src/app/tools/password-generator.component.html +++ b/src/app/tools/password-generator.component.html @@ -53,34 +53,34 @@
- +
- +
+ [(ngModel)]="options.uppercase" [disabled]="enforcedPolicyOptions?.useUppercase">
+ [(ngModel)]="options.lowercase" [disabled]="enforcedPolicyOptions?.useLowercase">
+ [(ngModel)]="options.number" [disabled]="enforcedPolicyOptions?.useNumbers">
+ [(ngModel)]="options.special" [disabled]="enforcedPolicyOptions?.useSpecial">
diff --git a/src/app/tools/password-generator.component.ts b/src/app/tools/password-generator.component.ts index f2e3e47f8c..cb609e3be3 100644 --- a/src/app/tools/password-generator.component.ts +++ b/src/app/tools/password-generator.component.ts @@ -47,4 +47,12 @@ export class PasswordGeneratorComponent extends BasePasswordGeneratorComponent { lengthChanged() { document.getElementById('length').focus(); } + + minNumberChanged() { + document.getElementById('min-number').focus(); + } + + minSpecialChanged() { + document.getElementById('min-special').focus(); + } } diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts index cfac7b3759..b6c377751c 100644 --- a/src/app/vault/add-edit.component.ts +++ b/src/app/vault/add-edit.component.ts @@ -103,7 +103,7 @@ export class AddEditComponent extends BaseAddEditComponent { async generatePassword(): Promise { const confirmed = await super.generatePassword(); if (confirmed) { - const options = await this.passwordGenerationService.getOptions(); + const options = (await this.passwordGenerationService.getOptions())[0]; this.cipher.login.password = await this.passwordGenerationService.generatePassword(options); } return confirmed;