From 1ade3a5db5f2a08199f7f67f99c8fbfcf0f288bc Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Tue, 16 Dec 2025 10:22:39 -0800 Subject: [PATCH] [PM-27086] re-add setKdfConfig and setUserKey --- ...ault-set-initial-password.service.implementation.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts b/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts index 1ab4b12a66e..461c47292e2 100644 --- a/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts +++ b/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts @@ -321,7 +321,7 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi await this.masterPasswordService.setForceSetPasswordReason(ForceSetPasswordReason.None, userId); // User now has a password so update account decryption options in state - await this.updateAccountDecryptionPropertiesV2(unlockData, userId); + await this.updateAccountDecryptionPropertiesV2(unlockData, userKey, userId); /** * Set the private key only for new JIT provisioned users in MP encryption orgs. @@ -334,8 +334,6 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi await this.keyService.setPrivateKey(keyPair[1].encryptedString, userId); } - // await this.masterPasswordService.setMasterKeyHash(newLocalMasterKeyHash, userId); // TODO-rr-bw: how to handle local key hash? - if (resetPasswordAutoEnroll) { await this.handleResetPasswordAutoEnroll( authenticationData.masterPasswordAuthenticationHash, @@ -395,19 +393,21 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi private async updateAccountDecryptionPropertiesV2( unlockData: MasterPasswordUnlockData, + userKey: UserKey, userId: UserId, ) { const userDecryptionOpts = await firstValueFrom( this.userDecryptionOptionsService.userDecryptionOptionsById$(userId), ); userDecryptionOpts.hasMasterPassword = true; + await this.userDecryptionOptionsService.setUserDecryptionOptionsById( userId, userDecryptionOpts, ); - await this.masterPasswordService.setMasterPasswordUnlockData(unlockData, userId); - // await this.masterPasswordService.setMasterKey(masterKey, userId); // TODO-rr-bw: how to handle this? remove this? + await this.kdfConfigService.setKdfConfig(userId, unlockData.kdf); + await this.keyService.setUserKey(userKey, userId); } /**