@nibssplc/cams-sdk-react 1.0.0-rc.74 → 1.0.0-rc.75

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
@@ -506,12 +506,6 @@ function useCAMSMSALAuth(options) {
506
506
  })];
507
507
  case 2:
508
508
  response = _b.sent();
509
- console.log("Login Token response:", {
510
- accessToken: response.accessToken,
511
- idToken: response.idToken,
512
- });
513
- setAccessToken(response.accessToken);
514
- setIdToken(response.idToken);
515
509
  mfaConfig = {
516
510
  accessToken: response.accessToken,
517
511
  idToken: response.idToken,
@@ -522,9 +516,11 @@ function useCAMSMSALAuth(options) {
522
516
  return [4 /*yield*/, authenticator.GetUserMFAConfig(mfaConfig)];
523
517
  case 3:
524
518
  userConfig = _b.sent();
525
- camsSdk.Logger.info("MFA Authenticator initialized:", userConfig);
519
+ camsSdk.Logger.debug("MFA Authenticator initialized:", userConfig);
526
520
  // Don't persist as authenticated until MFA is complete
527
521
  if (typeof window !== "undefined" && userConfig.isValid) {
522
+ setAccessToken(response.accessToken);
523
+ setIdToken(response.idToken);
528
524
  localStorage.setItem(storageKey, JSON.stringify({
529
525
  isAuthenticated: false,
530
526
  requiresMFA: userConfig.userInfo.isMFAEnabled,
@@ -1040,8 +1036,8 @@ function CAMSProviderCore(props) {
1040
1036
  var value = React.useMemo(function () {
1041
1037
  auth.logout; var authRest = __rest(auth, ["logout"]);
1042
1038
  return __assign(__assign({}, authRest), { logout: enhancedLogout, user: userProfile, setUserProfile: setUserProfile, authMode: mode, onAuthSuccess: mode === "MSAL"
1043
- ? props.onAuthSuccess
1044
- : undefined, onAuthError: mode === "MSAL" ? props.onAuthError : undefined });
1039
+ ? (props).onAuthSuccess
1040
+ : undefined, onAuthError: mode === "MSAL" ? (props).onAuthError : undefined });
1045
1041
  }, [auth, userProfile, mode, props]);
1046
1042
  return jsxRuntime.jsx(CAMSContext.Provider, { value: value, children: children });
1047
1043
  }