Skip to content

Commit

Permalink
rewrite login checks
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1995 committed Sep 26, 2023
1 parent e190d80 commit d678f0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/openlogin/src/OpenLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OpenLogin {
if (!options.clientId) throw InitializationError.invalidParams("clientId is required");
if (!options.network) options.network = OPENLOGIN_NETWORK.SAPPHIRE_MAINNET;
if (!options.buildEnv) options.buildEnv = BUILD_ENV.PRODUCTION;
if (!options.sdkUrl) {
if (!options.sdkUrl && !options.useMpc) {
if (options.buildEnv === BUILD_ENV.DEVELOPMENT) {
options.sdkUrl = "http://localhost:3000";
} else if (options.buildEnv === BUILD_ENV.STAGING) {
Expand All @@ -50,7 +50,7 @@ class OpenLogin {
}
}

if (options.useMpc) {
if (options.useMpc && !options.sdkUrl) {
if (Object.values(TORUS_LEGACY_NETWORK).includes(options.network as TORUS_LEGACY_NETWORK_TYPE))
throw new Error("MPC is not supported on legacy networks");
if (options.buildEnv === BUILD_ENV.DEVELOPMENT) {
Expand Down

0 comments on commit d678f0e

Please sign in to comment.