@nibssplc/cams-sdk-react 0.0.1-beta.70 → 0.0.1-beta.71

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 CHANGED
@@ -300,7 +300,7 @@ function useCAMSMSALAuth(options) {
300
300
  setMfaAuthenticator(authenticator);
301
301
  setRequiresMFA(true);
302
302
  }
303
- console.log("App Code >>>", options.appCode);
303
+ camsSdk.Logger.debug("App Code", { ">>>": options.appCode });
304
304
  }
305
305
  else {
306
306
  localStorage.removeItem(storageKey);
@@ -463,6 +463,7 @@ function useCAMSMSALAuth(options) {
463
463
  switch (_a.label) {
464
464
  case 0:
465
465
  _a.trys.push([0, 2, , 3]);
466
+ camsSdk.Logger.info("Logging User Out");
466
467
  return [4 /*yield*/, instance.logoutRedirect()];
467
468
  case 1:
468
469
  _a.sent();
@@ -1214,8 +1215,8 @@ function CAMSProviderCore(props) {
1214
1215
  !auth.requiresMFA &&
1215
1216
  auth.isAuthenticated &&
1216
1217
  !userProfile) {
1217
- // MFA completed, extract profile from stored data
1218
- var storedData = getCookie(auth.storageKey);
1218
+ // MFA completed, extract profile from localStorage
1219
+ var storedData = localStorage.getItem(auth.storageKey);
1219
1220
  if (storedData) {
1220
1221
  try {
1221
1222
  var parsed = JSON.parse(storedData);
@@ -1226,7 +1227,7 @@ function CAMSProviderCore(props) {
1226
1227
  catch (_a) { }
1227
1228
  }
1228
1229
  }
1229
- }, [mode, auth, userProfile]);
1230
+ }, [mode, auth, userProfile, auth.storageKey]);
1230
1231
  var value = React.useMemo(function () {
1231
1232
  return (__assign(__assign({}, auth), { logout: enhancedLogout, userProfile: userProfile, setUserProfile: setUserProfile, authMode: mode }));
1232
1233
  }, [auth, userProfile, mode, mode === "MSAL" && "requiresMFA" in auth ? auth.requiresMFA : null]);
@@ -1867,7 +1868,7 @@ var MFAGate = function (_a) {
1867
1868
  if (!urlValidation.success) {
1868
1869
  throw new Error("Invalid MFAEndpoint: ".concat(urlValidation.error.issues[0].message));
1869
1870
  }
1870
- console.log("MFA Endpoint >>>", MFAEndpoint);
1871
+ camsSdk.Logger.debug("MFA Endpoint >>>", { MFAEndpoint: MFAEndpoint });
1871
1872
  // Only apply MFA gate for MSAL mode
1872
1873
  if (context.authMode !== "MSAL") {
1873
1874
  return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children });