@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.esm.js CHANGED
@@ -485,12 +485,6 @@ function useCAMSMSALAuth(options) {
485
485
  })];
486
486
  case 2:
487
487
  response = _b.sent();
488
- console.log("Login Token response:", {
489
- accessToken: response.accessToken,
490
- idToken: response.idToken,
491
- });
492
- setAccessToken(response.accessToken);
493
- setIdToken(response.idToken);
494
488
  mfaConfig = {
495
489
  accessToken: response.accessToken,
496
490
  idToken: response.idToken,
@@ -501,9 +495,11 @@ function useCAMSMSALAuth(options) {
501
495
  return [4 /*yield*/, authenticator.GetUserMFAConfig(mfaConfig)];
502
496
  case 3:
503
497
  userConfig = _b.sent();
504
- Logger.info("MFA Authenticator initialized:", userConfig);
498
+ Logger.debug("MFA Authenticator initialized:", userConfig);
505
499
  // Don't persist as authenticated until MFA is complete
506
500
  if (typeof window !== "undefined" && userConfig.isValid) {
501
+ setAccessToken(response.accessToken);
502
+ setIdToken(response.idToken);
507
503
  localStorage.setItem(storageKey, JSON.stringify({
508
504
  isAuthenticated: false,
509
505
  requiresMFA: userConfig.userInfo.isMFAEnabled,
@@ -1019,8 +1015,8 @@ function CAMSProviderCore(props) {
1019
1015
  var value = useMemo(function () {
1020
1016
  auth.logout; var authRest = __rest(auth, ["logout"]);
1021
1017
  return __assign(__assign({}, authRest), { logout: enhancedLogout, user: userProfile, setUserProfile: setUserProfile, authMode: mode, onAuthSuccess: mode === "MSAL"
1022
- ? props.onAuthSuccess
1023
- : undefined, onAuthError: mode === "MSAL" ? props.onAuthError : undefined });
1018
+ ? (props).onAuthSuccess
1019
+ : undefined, onAuthError: mode === "MSAL" ? (props).onAuthError : undefined });
1024
1020
  }, [auth, userProfile, mode, props]);
1025
1021
  return jsx(CAMSContext.Provider, { value: value, children: children });
1026
1022
  }