1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

[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.
This commit is contained in:
Addison Beck
2022-01-12 11:32:45 -05:00
committed by GitHub
parent c7ccb997bd
commit 957e010036

View File

@@ -53,7 +53,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction {
async isLocked(userId?: string): Promise<boolean> {
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.