From 65160f3bf437eb8c3d5209a6b6790b7a3870b1a6 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 22 Jun 2021 13:37:30 -0400 Subject: [PATCH] Fix cli lock and logout (#334) * Ensure order of operations * Key removal is necessary to properly lock * Update jslib --- jslib | 2 +- src/bw.ts | 3 ++- src/services/nodeEnvSecureStorage.service.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jslib b/jslib index 78ae9383fb..18bf616e2e 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 78ae9383fbc1035bd27c022756cfa1f510ae16c9 +Subproject commit 18bf616e2e0821a46b1cb71737d80b099a64b237 diff --git a/src/bw.ts b/src/bw.ts index 98916c75d5..175ea736c7 100644 --- a/src/bw.ts +++ b/src/bw.ts @@ -137,7 +137,8 @@ export class Main { this.storageService, this.i18nService, this.cryptoFunctionService); this.vaultTimeoutService = new VaultTimeoutService(this.cipherService, this.folderService, this.collectionService, this.cryptoService, this.platformUtilsService, this.storageService, - this.messagingService, this.searchService, this.userService, this.tokenService, null, null); + this.messagingService, this.searchService, this.userService, this.tokenService, + async () => await this.cryptoService.clearStoredKey('auto'), null); this.syncService = new SyncService(this.userService, this.apiService, this.settingsService, this.folderService, this.cipherService, this.cryptoService, this.collectionService, this.storageService, this.messagingService, this.policyService, this.sendService, diff --git a/src/services/nodeEnvSecureStorage.service.ts b/src/services/nodeEnvSecureStorage.service.ts index f2f0f8d75a..f964d45d8f 100644 --- a/src/services/nodeEnvSecureStorage.service.ts +++ b/src/services/nodeEnvSecureStorage.service.ts @@ -19,7 +19,7 @@ export class NodeEnvSecureStorageService implements StorageService { } async has(key: string): Promise { - return await this.get(key) != null; + return (await this.get(key)) != null; } async save(key: string, obj: any): Promise {