@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.cjs.js
CHANGED
|
@@ -1473,26 +1473,20 @@ function CAMSProviderCore(props) {
|
|
|
1473
1473
|
}
|
|
1474
1474
|
});
|
|
1475
1475
|
}); };
|
|
1476
|
-
// Handle MFA completion for MSAL mode
|
|
1477
1476
|
React.useEffect(function () {
|
|
1478
1477
|
if (mode === "MSAL" &&
|
|
1479
1478
|
"requiresMFA" in auth &&
|
|
1480
1479
|
!auth.requiresMFA &&
|
|
1481
1480
|
auth.isAuthenticated) {
|
|
1482
|
-
// MFA completed, extract profile from localStorage
|
|
1483
1481
|
var storedData = localStorage.getItem(auth.storageKey);
|
|
1484
1482
|
if (storedData) {
|
|
1485
1483
|
try {
|
|
1486
1484
|
var parsed = JSON.parse(storedData);
|
|
1487
|
-
console.log("Parsed storage data:", parsed);
|
|
1488
1485
|
if (parsed.userProfile) {
|
|
1489
|
-
console.log("Setting user profile:", parsed.userProfile);
|
|
1490
1486
|
setUserProfile(parsed.userProfile);
|
|
1491
1487
|
}
|
|
1492
1488
|
}
|
|
1493
|
-
catch (
|
|
1494
|
-
console.error("Error parsing stored data:", e);
|
|
1495
|
-
}
|
|
1489
|
+
catch (_a) { }
|
|
1496
1490
|
}
|
|
1497
1491
|
}
|
|
1498
1492
|
}, [
|
|
@@ -1509,6 +1503,7 @@ function CAMSProviderCore(props) {
|
|
|
1509
1503
|
return jsxRuntimeExports.jsx(CAMSContext.Provider, { value: value, children: children });
|
|
1510
1504
|
}
|
|
1511
1505
|
function UnifiedCAMSProvider(props) {
|
|
1506
|
+
var _a;
|
|
1512
1507
|
// Validate appCode is a valid GUID
|
|
1513
1508
|
var appCodeValidation = GuidSchema.safeParse(props.appCode);
|
|
1514
1509
|
if (!appCodeValidation.success) {
|
|
@@ -1516,6 +1511,9 @@ function UnifiedCAMSProvider(props) {
|
|
|
1516
1511
|
}
|
|
1517
1512
|
if (props.mode === "MSAL") {
|
|
1518
1513
|
var msalConfig = props.msalConfig, msalInstance = props.msalInstance;
|
|
1514
|
+
if (typeof window !== "undefined" && !((_a = window.crypto) === null || _a === void 0 ? void 0 : _a.subtle)) {
|
|
1515
|
+
throw new Error("Crypto API not available. Polyfill failed to load.");
|
|
1516
|
+
}
|
|
1519
1517
|
var instance = msalInstance || new msalBrowser.PublicClientApplication(msalConfig);
|
|
1520
1518
|
return (jsxRuntimeExports.jsx(msalReact.MsalProvider, { instance: instance, children: jsxRuntimeExports.jsx(CAMSProviderCore, __assign({}, props)) }));
|
|
1521
1519
|
}
|