@iblai/web-utils 1.10.3 → 1.10.4

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.d.ts CHANGED
@@ -1025,7 +1025,7 @@ declare const isNode: () => string | false;
1025
1025
  declare const isExpo: () => any;
1026
1026
  declare const isTauri: () => boolean;
1027
1027
  declare function isSafariBrowser(): boolean;
1028
- declare const getPlatform: () => "react-native" | "web" | "node" | "unknown";
1028
+ declare const getPlatform: () => "web" | "react-native" | "node" | "unknown";
1029
1029
  declare const safeRequire: (moduleName: string) => any;
1030
1030
  declare const getNextNavigation: () => any;
1031
1031
 
package/dist/index.esm.js CHANGED
@@ -9781,28 +9781,28 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9781
9781
  return;
9782
9782
  }
9783
9783
  }
9784
- // If there is a customDomainPlatformKey and user doesn't belong to that tenant,
9784
+ // If there is a effectiveRequestedTenant and user doesn't belong to that tenant,
9785
9785
  // redirect to auth to re-authenticate. Use a sessionStorage guard to prevent
9786
9786
  // an infinite loop: if we already tried once this session and the user still
9787
9787
  // doesn't belong after re-auth, surface the failure instead of looping.
9788
- if (customDomainPlatformKey) {
9789
- if (!(enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((tenant) => tenant.key === customDomainPlatformKey))) {
9790
- const guardKey = `tenant_access_attempt_${customDomainPlatformKey}`;
9788
+ if (effectiveRequestedTenant) {
9789
+ if (!(enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((tenant) => tenant.key === effectiveRequestedTenant))) {
9790
+ const guardKey = `tenant_access_attempt_${effectiveRequestedTenant}`;
9791
9791
  if (isWeb() && sessionStorage.getItem(guardKey)) {
9792
9792
  sessionStorage.removeItem(guardKey);
9793
- console.warn(`[TenantProvider] User still does not belong to custom domain tenant after re-auth: ${customDomainPlatformKey}`);
9794
- onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${customDomainPlatformKey}). Please contact your administrator.`);
9793
+ console.warn(`[TenantProvider] User still does not belong to tenant after re-auth: ${effectiveRequestedTenant}`);
9794
+ onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${effectiveRequestedTenant}). Please contact your administrator.`);
9795
9795
  return;
9796
9796
  }
9797
9797
  let joined = false;
9798
- joined = await joinAndActivateTenant(customDomainPlatformKey, {
9799
- platform_key: customDomainPlatformKey,
9800
- platform_name: customDomainPlatformKey,
9798
+ joined = await joinAndActivateTenant(effectiveRequestedTenant, {
9799
+ platform_key: effectiveRequestedTenant,
9800
+ platform_name: effectiveRequestedTenant,
9801
9801
  }, {
9802
- key: customDomainPlatformKey,
9802
+ key: effectiveRequestedTenant,
9803
9803
  is_admin: false,
9804
- org: customDomainPlatformKey,
9805
- platform_name: customDomainPlatformKey,
9804
+ org: effectiveRequestedTenant,
9805
+ platform_name: effectiveRequestedTenant,
9806
9806
  }, { handleVisitingTenant: false });
9807
9807
  if (isWeb()) {
9808
9808
  if (!joined) {