@nibssplc/cams-sdk-react 1.0.0-rc.64 → 1.0.0-rc.66

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
@@ -514,7 +514,6 @@ function useCAMSMSALAuth(options) {
514
514
  mfaConfig = {
515
515
  accessToken: response.accessToken,
516
516
  idToken: response.idToken,
517
- // appCode,
518
517
  provider: "MSAL",
519
518
  APIAuthEndpoint: MFAEndpoint,
520
519
  };
@@ -522,7 +521,8 @@ function useCAMSMSALAuth(options) {
522
521
  return [4 /*yield*/, authenticator.GetUserMFAConfig(mfaConfig)];
523
522
  case 3:
524
523
  userConfig = _b.sent();
525
- camsSdk.Logger.info("MFA Authenticator initialized:", userConfig);
524
+ camsSdk.Logger.debug("MFA Authenticator initialized:", userConfig);
525
+ console.log("MFA Authenticator initialized:", userConfig);
526
526
  setRequiresMFA(userConfig.userInfo.isMFAEnabled);
527
527
  // Don't persist as authenticated until MFA is complete
528
528
  if (typeof window !== "undefined") {
@@ -1485,20 +1485,7 @@ var useCredentialsHandler = function (onAuthComplete) {
1485
1485
  return [4 /*yield*/, authenticator.LoginADCredentials(credentials, CredentialsAuthEndpoint)];
1486
1486
  case 1:
1487
1487
  response = _a.sent();
1488
- // .then((data) => {
1489
- // context.isAuthenticated = true;
1490
- // (context as any).requiresMFA = false;
1491
- // context.setUserProfile({
1492
- // type: "AUTH_SUCCESS",
1493
- // userProfile: {
1494
- // ...data,
1495
- // },
1496
- // });
1497
- // })
1498
- // .catch((error) => {
1499
- // console.error("AD Login failed:", error);
1500
- // toast.error("❌ AD Login failed.");
1501
- // });
1488
+ console.log(response);
1502
1489
  if (response) {
1503
1490
  onAuthComplete(true, response);
1504
1491
  return [2 /*return*/, true];
@@ -1785,6 +1772,9 @@ var DefaultLoginPage = function (_a) {
1785
1772
  },
1786
1773
  });
1787
1774
  }
1775
+ else {
1776
+ sonner.toast.error("\u274C AD Login failed. ".concat((data === null || data === void 0 ? void 0 : data.message) || 'Unknown error'));
1777
+ }
1788
1778
  return [2 /*return*/];
1789
1779
  });
1790
1780
  }); }), handleSubmitCredentials = _d.handleSubmitCredentials, isCredAuthLoading = _d.loading, setIsCredAuthLoading = _d.setLoading;