mirror of
https://github.com/bitwarden/browser
synced 2026-02-25 17:13:24 +00:00
feat(change-password-component): Change Password Update [18720] - Undid some changes because they will be conflicts later on.
This commit is contained in:
@@ -8,7 +8,12 @@
|
||||
[policy]="masterPasswordPolicyOptions"
|
||||
></auth-password-callout>
|
||||
|
||||
<bit-form-field *ngIf="isChangePasswordFlow()">
|
||||
<bit-form-field
|
||||
*ngIf="
|
||||
flow === InputPasswordFlow.ChangePassword ||
|
||||
flow === InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation
|
||||
"
|
||||
>
|
||||
<bit-label>{{ "currentMasterPass" | i18n }}</bit-label>
|
||||
<input
|
||||
id="input-password-form_current-password"
|
||||
|
||||
@@ -263,7 +263,10 @@ export class InputPasswordComponent implements OnInit {
|
||||
}
|
||||
|
||||
// 2. Verify current password is correct (if necessary)
|
||||
if (this.isChangePasswordFlow()) {
|
||||
if (
|
||||
this.flow === InputPasswordFlow.ChangePassword ||
|
||||
this.flow === InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation
|
||||
) {
|
||||
const currentPasswordVerified = await this.verifyCurrentPassword(
|
||||
currentPassword,
|
||||
this.kdfConfig,
|
||||
@@ -311,7 +314,10 @@ export class InputPasswordComponent implements OnInit {
|
||||
kdfConfig: this.kdfConfig,
|
||||
};
|
||||
|
||||
if (this.isChangePasswordFlow()) {
|
||||
if (
|
||||
this.flow === InputPasswordFlow.ChangePassword ||
|
||||
this.flow === InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation
|
||||
) {
|
||||
const currentMasterKey = await this.keyService.makeMasterKey(
|
||||
currentPassword,
|
||||
this.email,
|
||||
@@ -545,11 +551,4 @@ export class InputPasswordComponent implements OnInit {
|
||||
protected getPasswordStrengthScore(score: PasswordStrengthScore) {
|
||||
this.passwordStrengthScore = score;
|
||||
}
|
||||
|
||||
protected isChangePasswordFlow(): boolean {
|
||||
return (
|
||||
this.flow === InputPasswordFlow.ChangePassword ||
|
||||
this.flow === InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user