1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-01 19:11:22 +00:00
Files
browser/libs/vault/src/cipher-form/services/default-cipher-form-generation.service.ts
Shane Melton 600c8de129 [PM-10100] Remove auto password generation (#10355)
* [PM-10100] Remove initial password generation on new Login ciphers

* [PM-10100] Update password help text

* [PM-10100] Fix linter
2024-08-07 12:57:05 -07:00

27 lines
945 B
TypeScript

import { Injectable } from "@angular/core";
import {
PasswordGenerationServiceAbstraction,
UsernameGenerationServiceAbstraction,
} from "@bitwarden/generator-legacy";
import { CipherFormGenerationService } from "../abstractions/cipher-form-generation.service";
@Injectable()
export class DefaultCipherFormGenerationService implements CipherFormGenerationService {
constructor(
private passwordGenerationService: PasswordGenerationServiceAbstraction,
private usernameGenerationService: UsernameGenerationServiceAbstraction,
) {}
async generatePassword(): Promise<string> {
const [options] = await this.passwordGenerationService.getOptions();
return await this.passwordGenerationService.generatePassword(options);
}
async generateUsername(): Promise<string> {
const options = await this.usernameGenerationService.getOptions();
return await this.usernameGenerationService.generateUsername(options);
}
}