@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 +1 -1
- package/dist/index.esm.js +12 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
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
|
|
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 (
|
|
9809
|
-
if (!(enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((tenant) => tenant.key ===
|
|
9810
|
-
const guardKey = `tenant_access_attempt_${
|
|
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
|
|
9814
|
-
onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${
|
|
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(
|
|
9819
|
-
platform_key:
|
|
9820
|
-
platform_name:
|
|
9818
|
+
joined = await joinAndActivateTenant(effectiveRequestedTenant, {
|
|
9819
|
+
platform_key: effectiveRequestedTenant,
|
|
9820
|
+
platform_name: effectiveRequestedTenant,
|
|
9821
9821
|
}, {
|
|
9822
|
-
key:
|
|
9822
|
+
key: effectiveRequestedTenant,
|
|
9823
9823
|
is_admin: false,
|
|
9824
|
-
org:
|
|
9825
|
-
platform_name:
|
|
9824
|
+
org: effectiveRequestedTenant,
|
|
9825
|
+
platform_name: effectiveRequestedTenant,
|
|
9826
9826
|
}, { handleVisitingTenant: false });
|
|
9827
9827
|
if (isWeb()) {
|
|
9828
9828
|
if (!joined) {
|