Skip to content

Commit 8902b57

Browse files
committed
add other beta
1 parent 80a70ea commit 8902b57

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

frontend/src/lib/constants/identity.constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { getEnvVars } from "$lib/utils/env-vars.utils";
33
const envVars = getEnvVars();
44

55
export const IDENTITY_SERVICE_URL = envVars.identityServiceUrl;
6+
export const BETA_IDENTITY_SERVICE_URL =
7+
"https://beta.identity.internetcomputer.org/";
68
export const OLD_MAINNET_IDENTITY_SERVICE_URL = "https://identity.ic0.app";
7-
export const BETA_IDENTITY_SERVICE_URL = "https://beta.identity.ic0.app";
9+
export const OLD_BETA_IDENTITY_SERVICE_URL = "https://beta.identity.ic0.app";
810

911
// The authentication expires after 60 minutes
1012
export const AUTH_SESSION_DURATION = BigInt(60 * 60 * 1_000_000_000);

frontend/src/lib/utils/auth.utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
BETA_IDENTITY_SERVICE_URL,
33
IDENTITY_SERVICE_URL,
4+
OLD_BETA_IDENTITY_SERVICE_URL,
45
OLD_MAINNET_IDENTITY_SERVICE_URL,
56
} from "$lib/constants/identity.constants";
67
import { AuthClient } from "@icp-sdk/auth/client";
@@ -47,9 +48,11 @@ export const loadIdentity = async (): Promise<Identity | undefined> => {
4748

4849
export const getIdentityProviderUrl = (): string => {
4950
// If we are in mainnet in the old domain, we use the old identity provider.
50-
if (location.host.startsWith("beta")) return BETA_IDENTITY_SERVICE_URL;
51-
if (location.host.endsWith(".ic0.app"))
51+
if (location.host.endsWith(".ic0.app")) {
52+
if (location.host.startsWith("beta")) return OLD_BETA_IDENTITY_SERVICE_URL;
5253
return OLD_MAINNET_IDENTITY_SERVICE_URL;
54+
}
5355

56+
if (location.host.startsWith("beta")) return BETA_IDENTITY_SERVICE_URL;
5457
return IDENTITY_SERVICE_URL;
5558
};

0 commit comments

Comments
 (0)