[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.
This commit is contained in:
Todd Martin 2023-06-30 16:34:12 -04:00 committed by GitHub
parent f8c1e6c60a
commit 3185c0a61b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -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: