From 802d38f52e9794567179b9bd9ffc475ceb31323f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 3 Jun 2019 09:53:18 -0400 Subject: [PATCH] webVaultHostname --- src/angular/components/lock.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/angular/components/lock.component.ts b/src/angular/components/lock.component.ts index 2a0249ccea..b8d238253d 100644 --- a/src/angular/components/lock.component.ts +++ b/src/angular/components/lock.component.ts @@ -15,6 +15,8 @@ import { ConstantsService } from '../../services/constants.service'; import { CipherString } from '../../models/domain/cipherString'; import { SymmetricCryptoKey } from '../../models/domain/symmetricCryptoKey'; +import { Utils } from '../../misc/utils'; + export class LockComponent implements OnInit { masterPassword: string = ''; pin: string = ''; @@ -33,14 +35,18 @@ export class LockComponent implements OnInit { protected platformUtilsService: PlatformUtilsService, protected messagingService: MessagingService, protected userService: UserService, protected cryptoService: CryptoService, protected storageService: StorageService, protected lockService: LockService, - protected environmentService: EnvironmentService) { } + protected environmentService: EnvironmentService) { } async ngOnInit() { this.pinSet = await this.lockService.isPinLockSet(); const hasKey = await this.cryptoService.hasKey(); this.pinLock = (this.pinSet[0] && hasKey) || this.pinSet[1]; this.email = await this.userService.getEmail(); - this.webVaultHostname = await new URL(this.environmentService.getWebVaultUrl()).hostname; + let vaultUrl = this.environmentService.getWebVaultUrl(); + if (vaultUrl == null) { + vaultUrl = 'https://bitwarden.com'; + } + this.webVaultHostname = Utils.getHostname(vaultUrl); } async submit() {