@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.js CHANGED
@@ -9801,28 +9801,28 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9801
9801
  return;
9802
9802
  }
9803
9803
  }
9804
- // If there is a customDomainPlatformKey and user doesn't belong to that tenant,
9804
+ // If there is a effectiveRequestedTenant and user doesn't belong to that tenant,
9805
9805
  // redirect to auth to re-authenticate. Use a sessionStorage guard to prevent
9806
9806
  // an infinite loop: if we already tried once this session and the user still
9807
9807
  // doesn't belong after re-auth, surface the failure instead of looping.
9808
- if (customDomainPlatformKey) {
9809
- if (!(enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((tenant) => tenant.key === customDomainPlatformKey))) {
9810
- const guardKey = `tenant_access_attempt_${customDomainPlatformKey}`;
9808
+ if (effectiveRequestedTenant) {
9809
+ if (!(enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((tenant) => tenant.key === effectiveRequestedTenant))) {
9810
+ const guardKey = `tenant_access_attempt_${effectiveRequestedTenant}`;
9811
9811
  if (isWeb() && sessionStorage.getItem(guardKey)) {
9812
9812
  sessionStorage.removeItem(guardKey);
9813
- console.warn(`[TenantProvider] User still does not belong to custom domain tenant after re-auth: ${customDomainPlatformKey}`);
9814
- onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${customDomainPlatformKey}). Please contact your administrator.`);
9813
+ console.warn(`[TenantProvider] User still does not belong to tenant after re-auth: ${effectiveRequestedTenant}`);
9814
+ onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${effectiveRequestedTenant}). Please contact your administrator.`);
9815
9815
  return;
9816
9816
  }
9817
9817
  let joined = false;
9818
- joined = await joinAndActivateTenant(customDomainPlatformKey, {
9819
- platform_key: customDomainPlatformKey,
9820
- platform_name: customDomainPlatformKey,
9818
+ joined = await joinAndActivateTenant(effectiveRequestedTenant, {
9819
+ platform_key: effectiveRequestedTenant,
9820
+ platform_name: effectiveRequestedTenant,
9821
9821
  }, {
9822
- key: customDomainPlatformKey,
9822
+ key: effectiveRequestedTenant,
9823
9823
  is_admin: false,
9824
- org: customDomainPlatformKey,
9825
- platform_name: customDomainPlatformKey,
9824
+ org: effectiveRequestedTenant,
9825
+ platform_name: effectiveRequestedTenant,
9826
9826
  }, { handleVisitingTenant: false });
9827
9827
  if (isWeb()) {
9828
9828
  if (!joined) {