Browse Source

[bug] Dont try and lock a vault that is already locked

Bug/AccountSwitching/DoNotLockIfLocked
addison 4 years ago
parent
commit
1696133212
  1. 3
      common/src/services/vaultTimeout.service.ts

3
common/src/services/vaultTimeout.service.ts

@ -60,6 +60,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction { @@ -60,6 +60,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction {
await this.cryptoService.getKey(KeySuffixOptions.Auto, userId);
}
console.debug(userId, await this.cryptoService.hasKeyInMemory(userId));
return !(await this.cryptoService.hasKeyInMemory(userId));
}
@ -77,7 +78,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction { @@ -77,7 +78,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction {
async lock(allowSoftLock = false, userId?: string): Promise<void> {
const authed = await this.stateService.getIsAuthenticated({ userId: userId });
if (!authed) {
if (!authed || await this.isLocked(userId)) {
return;
}

Loading…
Cancel
Save