@iblai/web-utils 1.2.1 → 1.2.3

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.esm.js CHANGED
@@ -3350,7 +3350,12 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
3350
3350
  if (isWeb() && sessionStorage.getItem(guardKey)) {
3351
3351
  sessionStorage.removeItem(guardKey);
3352
3352
  console.warn(`[TenantProvider] User still does not belong to custom domain tenant after re-auth: ${customDomainPlatformKey}`);
3353
- const joined = await joinAndActivateTenant(customDomainPlatformKey, {
3353
+ onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${customDomainPlatformKey}). Please contact your administrator.`);
3354
+ return;
3355
+ }
3356
+ let joined = false;
3357
+ if (isWeb()) {
3358
+ joined = await joinAndActivateTenant(customDomainPlatformKey, {
3354
3359
  platform_key: customDomainPlatformKey,
3355
3360
  platform_name: customDomainPlatformKey,
3356
3361
  }, {
@@ -3360,14 +3365,12 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
3360
3365
  platform_name: customDomainPlatformKey,
3361
3366
  }, { handleVisitingTenant: false });
3362
3367
  if (!joined) {
3363
- onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${customDomainPlatformKey}). Please contact your administrator.`);
3368
+ sessionStorage.setItem(guardKey, "1");
3364
3369
  }
3365
- return;
3366
3370
  }
3367
- if (isWeb()) {
3368
- sessionStorage.setItem(guardKey, "1");
3371
+ if (!joined) {
3372
+ redirectToAuthSpa === null || redirectToAuthSpa === void 0 ? void 0 : redirectToAuthSpa(undefined, undefined, true);
3369
3373
  }
3370
- redirectToAuthSpa === null || redirectToAuthSpa === void 0 ? void 0 : redirectToAuthSpa(undefined, undefined, true);
3371
3374
  return;
3372
3375
  }
3373
3376
  }