@iblai/web-utils 1.9.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1195,7 +1195,7 @@ async function redirectToAuthSpa(options) {
1195
1195
  logoutTimestamp: "ibl_logout_timestamp",
1196
1196
  loginTimestamp: "ibl_login_timestamp",
1197
1197
  tenantSwitching: "ibl_tenant_switching",
1198
- }, hasNonExpiredAuthToken, isOffline, preserveTokenKey, authRedirectProxy, isNativeApp, forceRedirect = false, } = options;
1198
+ }, hasNonExpiredAuthToken, isOffline, preserveTokenKey, authRedirectProxy, isNativeApp, scheme = "iblai-mentor://", forceRedirect = false, } = options;
1199
1199
  console.log("[redirectToAuthSpa] starting redirect to auth spa", redirectTo, platformKey, logout, saveRedirect, forceRedirect);
1200
1200
  // Skip if a tenant switch is already in progress
1201
1201
  if (!forceRedirect &&
@@ -1270,7 +1270,7 @@ async function redirectToAuthSpa(options) {
1270
1270
  window.localStorage.setItem(redirectPathStorageKey, redirectPath);
1271
1271
  }
1272
1272
  const platform = platformKey !== null && platformKey !== void 0 ? platformKey : getPlatformKey(redirectPath);
1273
- const redirectToUrl = `${window.location.origin}`;
1273
+ const redirectToUrl = (isNativeApp === null || isNativeApp === void 0 ? void 0 : isNativeApp()) ? scheme : `${window.location.origin}`;
1274
1274
  let authRedirectUrl = `${authUrl}/login?${queryParams.app}=${appName}`;
1275
1275
  authRedirectUrl += `&${queryParams.redirectTo}=${redirectToUrl}`;
1276
1276
  if (platform) {