@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.esm.js CHANGED
@@ -493,7 +493,6 @@ function useCAMSMSALAuth(options) {
493
493
  mfaConfig = {
494
494
  accessToken: response.accessToken,
495
495
  idToken: response.idToken,
496
- // appCode,
497
496
  provider: "MSAL",
498
497
  APIAuthEndpoint: MFAEndpoint,
499
498
  };
@@ -501,7 +500,8 @@ function useCAMSMSALAuth(options) {
501
500
  return [4 /*yield*/, authenticator.GetUserMFAConfig(mfaConfig)];
502
501
  case 3:
503
502
  userConfig = _b.sent();
504
- Logger.info("MFA Authenticator initialized:", userConfig);
503
+ Logger.debug("MFA Authenticator initialized:", userConfig);
504
+ console.log("MFA Authenticator initialized:", userConfig);
505
505
  setRequiresMFA(userConfig.userInfo.isMFAEnabled);
506
506
  // Don't persist as authenticated until MFA is complete
507
507
  if (typeof window !== "undefined") {
@@ -1464,20 +1464,7 @@ var useCredentialsHandler = function (onAuthComplete) {
1464
1464
  return [4 /*yield*/, authenticator.LoginADCredentials(credentials, CredentialsAuthEndpoint)];
1465
1465
  case 1:
1466
1466
  response = _a.sent();
1467
- // .then((data) => {
1468
- // context.isAuthenticated = true;
1469
- // (context as any).requiresMFA = false;
1470
- // context.setUserProfile({
1471
- // type: "AUTH_SUCCESS",
1472
- // userProfile: {
1473
- // ...data,
1474
- // },
1475
- // });
1476
- // })
1477
- // .catch((error) => {
1478
- // console.error("AD Login failed:", error);
1479
- // toast.error("❌ AD Login failed.");
1480
- // });
1467
+ console.log(response);
1481
1468
  if (response) {
1482
1469
  onAuthComplete(true, response);
1483
1470
  return [2 /*return*/, true];
@@ -1764,6 +1751,9 @@ var DefaultLoginPage = function (_a) {
1764
1751
  },
1765
1752
  });
1766
1753
  }
1754
+ else {
1755
+ toast.error("\u274C AD Login failed. ".concat((data === null || data === void 0 ? void 0 : data.message) || 'Unknown error'));
1756
+ }
1767
1757
  return [2 /*return*/];
1768
1758
  });
1769
1759
  }); }), handleSubmitCredentials = _d.handleSubmitCredentials, isCredAuthLoading = _d.loading, setIsCredAuthLoading = _d.setLoading;