@iblai/web-utils 1.10.5 → 1.10.6

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
@@ -9721,20 +9721,7 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9721
9721
  var _a;
9722
9722
  try {
9723
9723
  await joinTenant({ platform_key: tenantKey }).unwrap();
9724
- const formData = new FormData();
9725
- formData.append("platform_key", tenantKey);
9726
- const { data: newTenants } = await fetchUserTenants();
9727
- const enhancedNewTenants = await enhanceTenants(newTenants, tenantMetadata);
9728
- const { data: tokenResponse } = await getAppToken(formData).unwrap();
9729
- saveUserTokens === null || saveUserTokens === void 0 ? void 0 : saveUserTokens(tokenResponse);
9730
- saveCurrentTenant(newCurrentTenant);
9731
- if (enhancedNewTenants && enhancedNewTenants.length) {
9732
- saveUserTenants(enhancedNewTenants);
9733
- }
9734
- const rbacPermissions = await loadPlatformPermissions(tenantMetadata.platform_key);
9735
- onLoadPlatformPermissions === null || onLoadPlatformPermissions === void 0 ? void 0 : onLoadPlatformPermissions(rbacPermissions);
9736
9724
  onAutoJoinUserToTenant === null || onAutoJoinUserToTenant === void 0 ? void 0 : onAutoJoinUserToTenant((_a = tenantMetadata.platform_name) !== null && _a !== void 0 ? _a : tenantMetadata === null || tenantMetadata === void 0 ? void 0 : tenantMetadata.platform_key.toUpperCase());
9737
- saveTenant === null || saveTenant === void 0 ? void 0 : saveTenant(tenantKey);
9738
9725
  setUserIsAccessingPublicRoute(false);
9739
9726
  removeVisitingTenant === null || removeVisitingTenant === void 0 ? void 0 : removeVisitingTenant();
9740
9727
  return true;
@@ -9967,7 +9954,10 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9967
9954
  setIsLoading(false);
9968
9955
  return;
9969
9956
  }
9970
- await joinAndActivateTenant(tenantKey, data, newCurrentTenant);
9957
+ const joined = await joinAndActivateTenant(tenantKey, data, newCurrentTenant);
9958
+ if (joined) {
9959
+ handleTenantSwitch(tenantKey, true);
9960
+ }
9971
9961
  }
9972
9962
  else {
9973
9963
  if (!currentTenant) {