From 957e010036c89cfbcb0b526eea99c4b9e292b1f8 Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Wed, 12 Jan 2022 11:32:45 -0500 Subject: [PATCH] [bug] Ensure neverLock vaults can be manually locked (#607) The client side storage restructuring work incorrectly checks if a vault has ever been unlocked to determine neverLock scenerios, but production does the opposite. This creates an inability to never manually lock neverLock vaults. This commit sets that condition back to the way it was. --- common/src/services/vaultTimeout.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/services/vaultTimeout.service.ts b/common/src/services/vaultTimeout.service.ts index cd810e8c4e..544e6bc238 100644 --- a/common/src/services/vaultTimeout.service.ts +++ b/common/src/services/vaultTimeout.service.ts @@ -53,7 +53,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction { async isLocked(userId?: string): Promise { const neverLock = (await this.cryptoService.hasKeyStored(KeySuffixOptions.Auto, userId)) && - (await this.stateService.getEverBeenUnlocked({ userId: userId })); + !(await this.stateService.getEverBeenUnlocked({ userId: userId })); if (neverLock) { // TODO: This also _sets_ the key so when we check memory in the next line it finds a key. // We should refactor here.