From 4dea46f1addd949e4f564f8d0fe8039ccc66a655 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 13 Jun 2018 14:08:43 -0400 Subject: [PATCH] prod urls for web client --- src/services/api.service.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/services/api.service.ts b/src/services/api.service.ts index b365217fa7..7f581859f5 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -1,4 +1,4 @@ -import { ConstantsService } from './constants.service'; +import { DeviceType } from '../enums/deviceType'; import { ApiService as ApiServiceAbstraction } from '../abstractions/api.service'; import { PlatformUtilsService } from '../abstractions/platformUtils.service'; @@ -37,8 +37,9 @@ export class ApiService implements ApiServiceAbstraction { constructor(private tokenService: TokenService, private platformUtilsService: PlatformUtilsService, private logoutCallback: (expired: boolean) => Promise) { - this.deviceType = platformUtilsService.getDevice().toString(); - this.isWebClient = platformUtilsService.identityClientId === 'web'; + const device = platformUtilsService.getDevice(); + this.deviceType = device.toString(); + this.isWebClient = device === DeviceType.Web; } setUrls(urls: EnvironmentUrls): void { @@ -75,8 +76,13 @@ export class ApiService implements ApiServiceAbstraction { //this.identityBaseUrl = 'https://preview-identity.bitwarden.com'; // Production - this.baseUrl = 'https://api.bitwarden.com'; - this.identityBaseUrl = 'https://identity.bitwarden.com'; + if (this.isWebClient) { + this.baseUrl = 'https://vault.bitwarden.com/api'; + this.identityBaseUrl = 'https://vault.bitwarden.com/identity'; + } else { + this.baseUrl = 'https://api.bitwarden.com'; + this.identityBaseUrl = 'https://identity.bitwarden.com'; + } /* tslint:enable */ }