mirror of
https://github.com/bitwarden/browser
synced 2026-02-17 09:59:41 +00:00
[PM-27086] refactor addition of optional currentPassword and rotateUserKey properties to only happen in certain flows
This commit is contained in:
@@ -371,15 +371,24 @@ export class InputPasswordComponent implements OnInit {
|
||||
if (newApisFlagEnabled) {
|
||||
// 4. Build a PasswordInputResult object
|
||||
const passwordInputResult: PasswordInputResult = {
|
||||
currentPassword,
|
||||
newPassword,
|
||||
kdfConfig: this.kdfConfig,
|
||||
salt,
|
||||
newPasswordHint,
|
||||
rotateUserKey: this.formGroup.controls.rotateUserKey?.value ?? false,
|
||||
newApisFlagEnabled, // To be removed in PM-28143
|
||||
};
|
||||
|
||||
if (
|
||||
this.flow === InputPasswordFlow.ChangePassword ||
|
||||
this.flow === InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation
|
||||
) {
|
||||
passwordInputResult.currentPassword = currentPassword;
|
||||
}
|
||||
|
||||
if (this.flow === InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation) {
|
||||
passwordInputResult.rotateUserKey = this.formGroup.controls.rotateUserKey?.value;
|
||||
}
|
||||
|
||||
// 5. Emit and return PasswordInputResult object
|
||||
this.onPasswordFormSubmit.emit(passwordInputResult);
|
||||
return passwordInputResult;
|
||||
|
||||
Reference in New Issue
Block a user