From 3185c0a61b53420c9223d69d6c4d46fa89077ee7 Mon Sep 17 00:00:00 2001 From: Todd Martin <106564991+trmartin4@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:34:12 -0400 Subject: [PATCH] [PM-2793] Modified bad base URL logic to not also catch web app (#5699) * Modified bad base URL logic to not also catch web app. * Removed EU from check. --- .../src/platform/services/environment.service.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/common/src/platform/services/environment.service.ts b/libs/common/src/platform/services/environment.service.ts index 6b27f9c13c..071335dada 100644 --- a/libs/common/src/platform/services/environment.service.ts +++ b/libs/common/src/platform/services/environment.service.ts @@ -159,15 +159,14 @@ export class EnvironmentService implements EnvironmentServiceAbstraction { const savedUrls = await this.stateService.getEnvironmentUrls(); const envUrls = new EnvironmentUrls(); - // fix environment urls for old users - if (savedUrls.base === "https://vault.bitwarden.com") { + // In release `2023.5.0`, we set the `base` property of the environment URLs to the US web vault URL when a user clicked the "US" region. + // This check will detect these cases and convert them to the proper region instead. + // We are detecting this by checking for the presence of the web vault URL in the `base` and the absence of the `notifications` property. + // This is because the `notifications` will not be `null` in the web vault, and we don't want to migrate the URLs in that case. + if (savedUrls.base === "https://vault.bitwarden.com" && savedUrls.notifications == null) { await this.setRegion(Region.US); return; } - if (savedUrls.base === "https://vault.bitwarden.eu") { - await this.setRegion(Region.EU); - return; - } switch (region) { case Region.EU: