mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 19:23:52 +00:00
Enforce Password Generator Policy Options (#1155)
This commit is contained in:
@@ -57,7 +57,7 @@ export default class CommandsBackground {
|
||||
return;
|
||||
}
|
||||
|
||||
const options = await this.passwordGenerationService.getOptions();
|
||||
const options = (await this.passwordGenerationService.getOptions())[0];
|
||||
const password = await this.passwordGenerationService.generatePassword(options);
|
||||
this.platformUtilsService.copyToClipboard(password, { window: window });
|
||||
this.passwordGenerationService.addHistory(password);
|
||||
|
||||
@@ -37,7 +37,7 @@ export default class ContextMenusBackground {
|
||||
}
|
||||
|
||||
private async generatePasswordToClipboard() {
|
||||
const options = await this.passwordGenerationService.getOptions();
|
||||
const options = (await this.passwordGenerationService.getOptions())[0];
|
||||
const password = await this.passwordGenerationService.generatePassword(options);
|
||||
this.platformUtilsService.copyToClipboard(password, { window: window });
|
||||
this.passwordGenerationService.addHistory(password);
|
||||
|
||||
@@ -175,7 +175,8 @@ export default class MainBackground {
|
||||
async (expired: boolean) => await this.logout(expired));
|
||||
this.eventService = new EventService(this.storageService, this.apiService, this.userService,
|
||||
this.cipherService);
|
||||
this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService);
|
||||
this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService,
|
||||
this.policyService);
|
||||
this.totpService = new TotpService(this.storageService, cryptoFunctionService);
|
||||
this.autofillService = new AutofillService(this.cipherService, this.userService, this.totpService,
|
||||
this.eventService);
|
||||
|
||||
Reference in New Issue
Block a user