@nibssplc/cams-sdk-react 1.0.0-rc.41 → 1.0.0-rc.42
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.cjs.js +5 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -7
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1452,26 +1452,20 @@ function CAMSProviderCore(props) {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
});
|
|
1454
1454
|
}); };
|
|
1455
|
-
// Handle MFA completion for MSAL mode
|
|
1456
1455
|
useEffect(function () {
|
|
1457
1456
|
if (mode === "MSAL" &&
|
|
1458
1457
|
"requiresMFA" in auth &&
|
|
1459
1458
|
!auth.requiresMFA &&
|
|
1460
1459
|
auth.isAuthenticated) {
|
|
1461
|
-
// MFA completed, extract profile from localStorage
|
|
1462
1460
|
var storedData = localStorage.getItem(auth.storageKey);
|
|
1463
1461
|
if (storedData) {
|
|
1464
1462
|
try {
|
|
1465
1463
|
var parsed = JSON.parse(storedData);
|
|
1466
|
-
console.log("Parsed storage data:", parsed);
|
|
1467
1464
|
if (parsed.userProfile) {
|
|
1468
|
-
console.log("Setting user profile:", parsed.userProfile);
|
|
1469
1465
|
setUserProfile(parsed.userProfile);
|
|
1470
1466
|
}
|
|
1471
1467
|
}
|
|
1472
|
-
catch (
|
|
1473
|
-
console.error("Error parsing stored data:", e);
|
|
1474
|
-
}
|
|
1468
|
+
catch (_a) { }
|
|
1475
1469
|
}
|
|
1476
1470
|
}
|
|
1477
1471
|
}, [
|
|
@@ -1488,6 +1482,7 @@ function CAMSProviderCore(props) {
|
|
|
1488
1482
|
return jsxRuntimeExports.jsx(CAMSContext.Provider, { value: value, children: children });
|
|
1489
1483
|
}
|
|
1490
1484
|
function UnifiedCAMSProvider(props) {
|
|
1485
|
+
var _a;
|
|
1491
1486
|
// Validate appCode is a valid GUID
|
|
1492
1487
|
var appCodeValidation = GuidSchema.safeParse(props.appCode);
|
|
1493
1488
|
if (!appCodeValidation.success) {
|
|
@@ -1495,6 +1490,9 @@ function UnifiedCAMSProvider(props) {
|
|
|
1495
1490
|
}
|
|
1496
1491
|
if (props.mode === "MSAL") {
|
|
1497
1492
|
var msalConfig = props.msalConfig, msalInstance = props.msalInstance;
|
|
1493
|
+
if (typeof window !== "undefined" && !((_a = window.crypto) === null || _a === void 0 ? void 0 : _a.subtle)) {
|
|
1494
|
+
throw new Error("Crypto API not available. Polyfill failed to load.");
|
|
1495
|
+
}
|
|
1498
1496
|
var instance = msalInstance || new PublicClientApplication(msalConfig);
|
|
1499
1497
|
return (jsxRuntimeExports.jsx(MsalProvider, { instance: instance, children: jsxRuntimeExports.jsx(CAMSProviderCore, __assign({}, props)) }));
|
|
1500
1498
|
}
|