diff --git a/apps/web/src/app/auth/settings/change-password.component.ts b/apps/web/src/app/auth/settings/change-password.component.ts index 389264f4a9b..65a43d4bfcf 100644 --- a/apps/web/src/app/auth/settings/change-password.component.ts +++ b/apps/web/src/app/auth/settings/change-password.component.ts @@ -176,6 +176,7 @@ export class ChangePasswordComponent this.currentMasterPassword, this.masterPassword, user, + this.masterPasswordHint, ); } else { await this.keyRotationService.rotateUserKeyAndEncryptedDataLegacy( diff --git a/apps/web/src/app/key-management/key-rotation/request/master-password-unlock-data.request.ts b/apps/web/src/app/key-management/key-rotation/request/master-password-unlock-data.request.ts index 5e74d0273b3..95e54e16464 100644 --- a/apps/web/src/app/key-management/key-rotation/request/master-password-unlock-data.request.ts +++ b/apps/web/src/app/key-management/key-rotation/request/master-password-unlock-data.request.ts @@ -11,11 +11,14 @@ export class MasterPasswordUnlockDataRequest { masterKeyEncryptedUserKey: string; + masterPasswordHint?: string; + constructor( kdfConfig: KdfConfig, email: string, masterKeyAuthenticationHash: string, masterKeyEncryptedUserKey: string, + masterPasswordHash?: string, ) { this.kdfType = kdfConfig.kdfType; this.kdfIterations = kdfConfig.iterations; @@ -27,5 +30,6 @@ export class MasterPasswordUnlockDataRequest { this.email = email; this.masterKeyAuthenticationHash = masterKeyAuthenticationHash; this.masterKeyEncryptedUserKey = masterKeyEncryptedUserKey; + this.masterPasswordHint = masterPasswordHash; } } diff --git a/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts b/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts index 2e9d7ea29d9..2b1f5a7057d 100644 --- a/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts +++ b/apps/web/src/app/key-management/key-rotation/user-key-rotation.service.ts @@ -72,6 +72,7 @@ export class UserKeyRotationService { oldMasterPassword: string, newMasterPassword: string, user: Account, + newMasterPasswordHint?: string, ): Promise { this.logService.info("[Userkey rotation] Starting user key rotation..."); if (!newMasterPassword) { @@ -119,6 +120,7 @@ export class UserKeyRotationService { email, newMasterKeyAuthenticationHash, newMasterKeyEncryptedUserKey.encryptedString, + newMasterPasswordHint, ); const { privateKey, publicKey } = await firstValueFrom( this.keyService.userEncryptionKeyPair$(user.id),