From cb1a62ee2753c902fc8f8d23b046c2d0a3c6e494 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 21 Jun 2018 22:10:20 -0400 Subject: [PATCH] set proper api url --- src/app/services/services.module.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 9c59f47189..3aeb9bbe49 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -111,13 +111,12 @@ containerService.attachToWindow(window); export function initFactory(): Function { return async () => { - if (platformUtilsService.isDev()) { - await apiService.setUrls({ - base: null, - api: 'https://api.bitwarden.com', - identity: 'https://identity.bitwarden.com', - }); - } // TODO: elseif self host + const isDev = platformUtilsService.isDev(); + await apiService.setUrls({ + base: isDev ? null : window.location.origin, + api: isDev ? 'https://api.bitwarden.com' : null, + identity: isDev ? 'https://identity.bitwarden.com' : null, + }); lockService.init(true); const locale = await storageService.get(ConstantsService.localeKey);