@iblai/web-utils 1.2.3 → 1.2.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
@@ -3374,24 +3374,30 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
3374
3374
  return;
3375
3375
  }
3376
3376
  let joined = false;
3377
+ joined = await joinAndActivateTenant(customDomainPlatformKey, {
3378
+ platform_key: customDomainPlatformKey,
3379
+ platform_name: customDomainPlatformKey,
3380
+ }, {
3381
+ key: customDomainPlatformKey,
3382
+ is_admin: false,
3383
+ org: customDomainPlatformKey,
3384
+ platform_name: customDomainPlatformKey,
3385
+ }, { handleVisitingTenant: false });
3377
3386
  if (isWeb()) {
3378
- joined = await joinAndActivateTenant(customDomainPlatformKey, {
3379
- platform_key: customDomainPlatformKey,
3380
- platform_name: customDomainPlatformKey,
3381
- }, {
3382
- key: customDomainPlatformKey,
3383
- is_admin: false,
3384
- org: customDomainPlatformKey,
3385
- platform_name: customDomainPlatformKey,
3386
- }, { handleVisitingTenant: false });
3387
3387
  if (!joined) {
3388
3388
  sessionStorage.setItem(guardKey, "1");
3389
3389
  }
3390
+ else {
3391
+ const { data: tenants } = await fetchUserTenants();
3392
+ console.log("[determineWhichTenantToUse] tenants after joining are ", tenants);
3393
+ // Enhance tenants with platform metadata
3394
+ enhancedTenants = await enhanceTenants(tenants);
3395
+ }
3390
3396
  }
3391
3397
  if (!joined) {
3392
3398
  redirectToAuthSpa === null || redirectToAuthSpa === void 0 ? void 0 : redirectToAuthSpa(undefined, undefined, true);
3399
+ return;
3393
3400
  }
3394
- return;
3395
3401
  }
3396
3402
  }
3397
3403
  saveUserTenants(enhancedTenants);