@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.d.ts
CHANGED
|
@@ -1025,7 +1025,7 @@ declare const isNode: () => string | false;
|
|
|
1025
1025
|
declare const isExpo: () => any;
|
|
1026
1026
|
declare const isTauri: () => boolean;
|
|
1027
1027
|
declare function isSafariBrowser(): boolean;
|
|
1028
|
-
declare const getPlatform: () => "
|
|
1028
|
+
declare const getPlatform: () => "web" | "react-native" | "node" | "unknown";
|
|
1029
1029
|
declare const safeRequire: (moduleName: string) => any;
|
|
1030
1030
|
declare const getNextNavigation: () => any;
|
|
1031
1031
|
|
package/dist/index.esm.js
CHANGED
|
@@ -9781,28 +9781,28 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
|
|
|
9781
9781
|
return;
|
|
9782
9782
|
}
|
|
9783
9783
|
}
|
|
9784
|
-
// If there is a
|
|
9784
|
+
// If there is a effectiveRequestedTenant and user doesn't belong to that tenant,
|
|
9785
9785
|
// redirect to auth to re-authenticate. Use a sessionStorage guard to prevent
|
|
9786
9786
|
// an infinite loop: if we already tried once this session and the user still
|
|
9787
9787
|
// doesn't belong after re-auth, surface the failure instead of looping.
|
|
9788
|
-
if (
|
|
9789
|
-
if (!(enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((tenant) => tenant.key ===
|
|
9790
|
-
const guardKey = `tenant_access_attempt_${
|
|
9788
|
+
if (effectiveRequestedTenant) {
|
|
9789
|
+
if (!(enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((tenant) => tenant.key === effectiveRequestedTenant))) {
|
|
9790
|
+
const guardKey = `tenant_access_attempt_${effectiveRequestedTenant}`;
|
|
9791
9791
|
if (isWeb() && sessionStorage.getItem(guardKey)) {
|
|
9792
9792
|
sessionStorage.removeItem(guardKey);
|
|
9793
|
-
console.warn(`[TenantProvider] User still does not belong to
|
|
9794
|
-
onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${
|
|
9793
|
+
console.warn(`[TenantProvider] User still does not belong to tenant after re-auth: ${effectiveRequestedTenant}`);
|
|
9794
|
+
onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(`You do not have access to this platform (${effectiveRequestedTenant}). Please contact your administrator.`);
|
|
9795
9795
|
return;
|
|
9796
9796
|
}
|
|
9797
9797
|
let joined = false;
|
|
9798
|
-
joined = await joinAndActivateTenant(
|
|
9799
|
-
platform_key:
|
|
9800
|
-
platform_name:
|
|
9798
|
+
joined = await joinAndActivateTenant(effectiveRequestedTenant, {
|
|
9799
|
+
platform_key: effectiveRequestedTenant,
|
|
9800
|
+
platform_name: effectiveRequestedTenant,
|
|
9801
9801
|
}, {
|
|
9802
|
-
key:
|
|
9802
|
+
key: effectiveRequestedTenant,
|
|
9803
9803
|
is_admin: false,
|
|
9804
|
-
org:
|
|
9805
|
-
platform_name:
|
|
9804
|
+
org: effectiveRequestedTenant,
|
|
9805
|
+
platform_name: effectiveRequestedTenant,
|
|
9806
9806
|
}, { handleVisitingTenant: false });
|
|
9807
9807
|
if (isWeb()) {
|
|
9808
9808
|
if (!joined) {
|