From ab506ffbdbd1a9bb2d6161aea69005cbc45fa4d9 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 21 May 2020 14:31:53 +0200 Subject: [PATCH 1/4] Resolve edit always being true for ciphers I noticed that ciphers will always have `edit = True` even if the sync response has `edit = false`. The root cause seems to be a boolean default to true. And since `false || true => true` it would always be set to true. --- src/models/response/cipherResponse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/response/cipherResponse.ts b/src/models/response/cipherResponse.ts index 580e21fa7e3..d66e8f8447a 100644 --- a/src/models/response/cipherResponse.ts +++ b/src/models/response/cipherResponse.ts @@ -38,7 +38,7 @@ export class CipherResponse extends BaseResponse { this.name = this.getResponseProperty('Name'); this.notes = this.getResponseProperty('Notes'); this.favorite = this.getResponseProperty('Favorite') || false; - this.edit = this.getResponseProperty('Edit') || true; + this.edit = !!this.getResponseProperty('Edit'); this.organizationUseTotp = this.getResponseProperty('OrganizationUseTotp'); this.revisionDate = this.getResponseProperty('RevisionDate'); this.collectionIds = this.getResponseProperty('CollectionIds'); From 1bbd8081057701bda9452121c59fafc3971b5f9f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 27 May 2020 15:21:53 -0400 Subject: [PATCH 2/4] getEnterprisePortalSignInToken api (#105) --- src/abstractions/api.service.ts | 1 + src/services/api.service.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index 1fc71b9c1cf..dec3062ae78 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -139,6 +139,7 @@ export abstract class ApiService { postAccountRecoverDelete: (request: DeleteRecoverRequest) => Promise; postAccountRecoverDeleteToken: (request: VerifyDeleteRecoverRequest) => Promise; postAccountKdf: (request: KdfRequest) => Promise; + getEnterprisePortalSignInToken: () => Promise; getFolder: (id: string) => Promise; postFolder: (request: FolderRequest) => Promise; diff --git a/src/services/api.service.ts b/src/services/api.service.ts index 70a91f36c3f..e8c5c0d462c 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -321,6 +321,11 @@ export class ApiService implements ApiServiceAbstraction { return this.send('POST', '/accounts/kdf', request, true, false); } + async getEnterprisePortalSignInToken(): Promise { + const r = await this.send('GET', '/accounts/enterprise-portal-signin-token', null, true, true); + return r as string; + } + // Folder APIs async getFolder(id: string): Promise { From 212a2e3745e6e0e2b3057ed308c47daf6aeefbc8 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Thu, 28 May 2020 13:09:55 -0500 Subject: [PATCH 3/4] Bug fix: made lock default conditional check (#106) --- src/services/vaultTimeout.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/vaultTimeout.service.ts b/src/services/vaultTimeout.service.ts index bc13667f9bf..2601dc54545 100644 --- a/src/services/vaultTimeout.service.ts +++ b/src/services/vaultTimeout.service.ts @@ -81,7 +81,7 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction { if (diffSeconds >= vaultTimeoutSeconds) { // Pivot based on the saved vault timeout action const timeoutAction = await this.storageService.get(ConstantsService.vaultTimeoutActionKey); - timeoutAction === 'lock' ? await this.lock(true) : await this.logOut(); + timeoutAction === 'logOut' ? await this.logOut() : await this.lock(true); } } From eef9588646091d268ef4c94f3d6db1412d9a99ab Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 1 Jun 2020 14:31:42 -0400 Subject: [PATCH 4/4] check for empty string on malformed URL (#108) --- src/misc/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/utils.ts b/src/misc/utils.ts index 5c86ccd94c5..e0b70413560 100644 --- a/src/misc/utils.ts +++ b/src/misc/utils.ts @@ -157,7 +157,7 @@ export class Utils { static getHostname(uriString: string): string { const url = Utils.getUrl(uriString); try { - return url != null ? url.hostname : null; + return url != null && url.hostname !== '' ? url.hostname : null; } catch { return null; } @@ -166,7 +166,7 @@ export class Utils { static getHost(uriString: string): string { const url = Utils.getUrl(uriString); try { - return url != null ? url.host : null; + return url != null && url.host !== '' ? url.host : null; } catch { return null; }