From 8e4073f1cafa5348fd5120003411b1ac673667a8 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Mon, 13 May 2024 14:18:54 -0700 Subject: [PATCH] fix migration test (#9163) --- .../auth/src/common/services/pin/pin.service.implementation.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/auth/src/common/services/pin/pin.service.implementation.ts b/libs/auth/src/common/services/pin/pin.service.implementation.ts index 9e2e575eeb..61586fae46 100644 --- a/libs/auth/src/common/services/pin/pin.service.implementation.ts +++ b/libs/auth/src/common/services/pin/pin.service.implementation.ts @@ -387,9 +387,10 @@ export class PinService implements PinServiceAbstraction { ); const encUserKey = await this.stateService.getEncryptedCryptoSymmetricKey({ userId: userId }); + const userKey = await this.masterPasswordService.decryptUserKeyWithMasterKey( masterKey, - new EncString(encUserKey), + encUserKey ? new EncString(encUserKey) : undefined, ); const pinKeyEncryptedUserKey = await this.createPinKeyEncryptedUserKey(pin, userKey, userId);