1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

refactor(account-recovery): [PM-18721][PM-21272] Integrate InputPasswordComponent in AccountRecoveryDialogComponent (#14662)

Integrates the `InputPasswordComponent` within the new `AccountRecoveryDialogComponent`.

Feature flag: `PM16117_ChangeExistingPasswordRefactor`
This commit is contained in:
rr-bw
2025-06-25 07:29:22 -07:00
committed by GitHub
parent 1b441e8a0f
commit 1df54c71be
9 changed files with 229 additions and 14 deletions

View File

@@ -261,7 +261,7 @@ export class InputPasswordComponent implements OnInit {
}
}
submit = async () => {
submit = async (): Promise<PasswordInputResult | undefined> => {
try {
this.isSubmitting.emit(true);
@@ -280,8 +280,7 @@ export class InputPasswordComponent implements OnInit {
const checkForBreaches = this.formGroup.controls.checkForBreaches?.value ?? true;
if (this.flow === InputPasswordFlow.ChangePasswordDelegation) {
await this.handleChangePasswordDelegationFlow(newPassword);
return;
return await this.handleChangePasswordDelegationFlow(newPassword);
}
if (!this.email) {
@@ -388,6 +387,7 @@ export class InputPasswordComponent implements OnInit {
// 5. Emit cryptographic keys and other password related properties
this.onPasswordFormSubmit.emit(passwordInputResult);
return passwordInputResult;
} catch (e) {
this.validationService.showError(e);
} finally {
@@ -441,7 +441,9 @@ export class InputPasswordComponent implements OnInit {
}
}
private async handleChangePasswordDelegationFlow(newPassword: string) {
private async handleChangePasswordDelegationFlow(
newPassword: string,
): Promise<PasswordInputResult | undefined> {
const newPasswordVerified = await this.verifyNewPassword(
newPassword,
this.passwordStrengthScore,
@@ -456,6 +458,7 @@ export class InputPasswordComponent implements OnInit {
};
this.onPasswordFormSubmit.emit(passwordInputResult);
return passwordInputResult;
}
/**