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);