@nibssplc/cams-sdk-react 1.0.0-rc.101 → 1.0.0-rc.103

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
@@ -1576,14 +1576,20 @@ var MFAOptions = function (_a) {
1576
1576
  var _f = React.useState(false), showSuccessAnimation = _f[0], setShowSuccessAnimation = _f[1];
1577
1577
  var _g = React.useState(null), authType = _g[0], setAuthType = _g[1];
1578
1578
  var context = useCAMSContext();
1579
- var _h = context.authMode === "MSAL" && "EmailOTP" in context
1580
- ? context
1581
- : { completeMFA: null, logout: function () { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1582
- return [2 /*return*/];
1583
- }); }); } }, completeMFA = _h.completeMFA, logout = _h.logout;
1579
+ // Type-safe extraction of completeMFA and logout
1580
+ var completeMFA = context.authMode === "MSAL"
1581
+ ? context.completeMFA
1582
+ : function (data) { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1583
+ return [2 /*return*/, data];
1584
+ }); }); };
1585
+ var logout = context.authMode === "MSAL"
1586
+ ? context.logout
1587
+ : function () { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1588
+ return [2 /*return*/];
1589
+ }); }); };
1584
1590
  var authenticate = useWebAuthn().authenticate;
1585
1591
  var authenticator = new camsSdk.CAMSMFAAuthenticator();
1586
- var _j = useOTPHandler({
1592
+ var _h = useOTPHandler({
1587
1593
  email: ((_c = (_b = context.user) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.email) || context.email,
1588
1594
  appCode: context.appCode || "",
1589
1595
  MFAEndpoint: MFAEndpoints.ValidateUserMFA,
@@ -1622,9 +1628,9 @@ var MFAOptions = function (_a) {
1622
1628
  }
1623
1629
  });
1624
1630
  }); },
1625
- }), handleSubmitOTP = _j.handleSubmitOTP, loading = _j.loading,
1631
+ }), handleSubmitOTP = _h.handleSubmitOTP, loading = _h.loading,
1626
1632
  // setLoading,
1627
- attemptCount = _j.attemptCount, remainingAttempts = _j.remainingAttempts, isMaxAttemptsReached = _j.isMaxAttemptsReached, resetAttempts = _j.resetAttempts;
1633
+ attemptCount = _h.attemptCount, remainingAttempts = _h.remainingAttempts, isMaxAttemptsReached = _h.isMaxAttemptsReached, resetAttempts = _h.resetAttempts;
1628
1634
  var handleGoBack = function () {
1629
1635
  setAuthType(null);
1630
1636
  setOtpVisible(false);