1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 22:13:32 +00:00

feat(change-password-component): Change Password Update [18720] - Tidied up code.

This commit is contained in:
Patrick Pimentel
2025-05-27 16:24:17 -04:00
parent 356da9885a
commit 7386fd8780
7 changed files with 30 additions and 38 deletions

View File

@@ -10,7 +10,6 @@ import {
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options";
import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason";
import { MasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
@@ -67,8 +66,6 @@ export enum InputPasswordFlow {
ChangePassword,
/**
* All form elements above, plus: [Checkbox] Rotate account encryption key (as the last element in the UI)
*
* Consider changing this to an input.
*/
ChangePasswordWithOptionalUserKeyRotation,
}
@@ -111,8 +108,7 @@ export class InputPasswordComponent implements OnInit {
@Input() userId?: UserId;
@Input() loading = false;
@Input() masterPasswordPolicyOptions: MasterPasswordPolicyOptions | undefined = undefined;
@Input() forceSetPasswordReason?: ForceSetPasswordReason;
@Input() masterPasswordPolicyOptions?: MasterPasswordPolicyOptions;
@Input() inlineButtons = false;
@Input() primaryButtonText?: Translation;
@@ -548,10 +544,6 @@ export class InputPasswordComponent implements OnInit {
this.passwordStrengthScore = score;
}
/**
* Checks if the flow is either ChangePassword or ChangePasswordWithOptionalUserKeyRotation
* @private
*/
protected isChangePasswordFlow(): boolean {
return (
this.flow === InputPasswordFlow.ChangePassword ||