mirror of
https://github.com/bitwarden/browser
synced 2026-02-09 13:10:17 +00:00
update kdf param type, inputPasswordFlow on PasswordSettingsComponent
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
<bit-callout type="warning">{{ "loggedOutWarning" | i18n }}</bit-callout>
|
||||
|
||||
<div class="tw-max-w-md tw-mb-12">
|
||||
<auth-change-existing-password></auth-change-existing-password>
|
||||
<auth-change-existing-password
|
||||
[inputPasswordFlow]="InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation"
|
||||
></auth-change-existing-password>
|
||||
</div>
|
||||
|
||||
<app-webauthn-login-settings></app-webauthn-login-settings>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, OnInit } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
import { ChangeExistingPasswordComponent } from "@bitwarden/auth/angular";
|
||||
import { ChangeExistingPasswordComponent, InputPasswordFlow } from "@bitwarden/auth/angular";
|
||||
import { UserDecryptionOptionsServiceAbstraction } from "@bitwarden/auth/common";
|
||||
import { CalloutModule } from "@bitwarden/components";
|
||||
import { I18nPipe } from "@bitwarden/ui-common";
|
||||
@@ -16,6 +16,8 @@ import { WebauthnLoginSettingsModule } from "../../webauthn-login-settings";
|
||||
imports: [CalloutModule, ChangeExistingPasswordComponent, I18nPipe, WebauthnLoginSettingsModule],
|
||||
})
|
||||
export class PasswordSettingsComponent implements OnInit {
|
||||
InputPasswordFlow = InputPasswordFlow;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private userDecryptionOptionsService: UserDecryptionOptionsServiceAbstraction,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<auth-input-password
|
||||
[inputPasswordFlow]="
|
||||
InputPasswordFlow.ChangeExistingPasswordAndOptionallyRotateAccountEncryptionKey
|
||||
"
|
||||
[inputPasswordFlow]="inputPasswordFlow"
|
||||
[email]="email"
|
||||
[masterPasswordPolicyOptions]="masterPasswordPolicyOptions"
|
||||
[inlineButtons]="true"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { Component, Input, OnInit } from "@angular/core";
|
||||
import { firstValueFrom, map } from "rxjs";
|
||||
|
||||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||
@@ -28,7 +28,7 @@ import { PasswordInputResult } from "../input-password/password-input-result";
|
||||
imports: [InputPasswordComponent],
|
||||
})
|
||||
export class ChangeExistingPasswordComponent implements OnInit {
|
||||
InputPasswordFlow = InputPasswordFlow;
|
||||
@Input() inputPasswordFlow: InputPasswordFlow = InputPasswordFlow.ChangePassword;
|
||||
|
||||
email?: string;
|
||||
masterPasswordPolicyOptions?: MasterPasswordPolicyOptions;
|
||||
@@ -72,7 +72,7 @@ export class ChangeExistingPasswordComponent implements OnInit {
|
||||
|
||||
async submitNew(passwordInputResult: PasswordInputResult) {
|
||||
try {
|
||||
if (passwordInputResult.rotateAccountEncryptionKey) {
|
||||
if (passwordInputResult.rotateUserKey) {
|
||||
await this.syncService.fullSync(true);
|
||||
// const user = await firstValueFrom(this.accountService.activeAccount$);
|
||||
// // TODO-rr-bw: make a ChangeExistingPasswordService with Default & Web implementations
|
||||
|
||||
@@ -20,7 +20,7 @@ import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
import { MasterKey, UserKey } from "@bitwarden/common/types/key";
|
||||
import { PBKDF2KdfConfig, KdfConfigService, KeyService } from "@bitwarden/key-management";
|
||||
import { KdfConfigService, KeyService, KdfConfig } from "@bitwarden/key-management";
|
||||
|
||||
import {
|
||||
SetPasswordCredentials,
|
||||
@@ -127,7 +127,7 @@ export class DefaultSetPasswordJitService implements SetPasswordJitService {
|
||||
|
||||
private async updateAccountDecryptionProperties(
|
||||
masterKey: MasterKey,
|
||||
kdfConfig: PBKDF2KdfConfig,
|
||||
kdfConfig: KdfConfig,
|
||||
protectedUserKey: [UserKey, EncString],
|
||||
userId: UserId,
|
||||
) {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// @ts-strict-ignore
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
import { MasterKey } from "@bitwarden/common/types/key";
|
||||
import { PBKDF2KdfConfig } from "@bitwarden/key-management";
|
||||
import { KdfConfig } from "@bitwarden/key-management";
|
||||
|
||||
export interface SetPasswordCredentials {
|
||||
masterKey: MasterKey;
|
||||
serverMasterKeyHash: string;
|
||||
localMasterKeyHash: string;
|
||||
kdfConfig: PBKDF2KdfConfig;
|
||||
kdfConfig: KdfConfig;
|
||||
hint: string;
|
||||
orgSsoIdentifier: string;
|
||||
orgId: string;
|
||||
|
||||
Reference in New Issue
Block a user