From 4694793785b1310ed8f4460733e866a9e15ac35b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 30 Jan 2018 13:13:12 -0500 Subject: [PATCH] reset domain to null if empty --- src/models/view/loginView.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/view/loginView.ts b/src/models/view/loginView.ts index 5bfa4318e6f..c3554c9c382 100644 --- a/src/models/view/loginView.ts +++ b/src/models/view/loginView.ts @@ -42,6 +42,9 @@ export class LoginView implements View { if (containerService) { const platformUtilsService: PlatformUtilsService = containerService.getPlatformUtilsService(); this._domain = platformUtilsService.getDomain(this.uri); + if (this._domain === '') { + this._domain = null; + } } else { throw new Error('window.bitwardenContainerService not initialized.'); } @@ -70,7 +73,7 @@ export class LoginView implements View { } get isWebsite(): boolean { - return this.uri != null && (this.uri.indexOf('http://') > -1 || this.uri.indexOf('https://') > -1); + return this.uri != null && (this.uri.indexOf('http://') === 0 || this.uri.indexOf('https://') === 0); } get canLaunch(): boolean {