@nibssplc/cams-sdk-react 1.0.0-rc.102 → 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,16 +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"
1580
- ? context
1581
- : { completeMFA: function (data) { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1582
- return [2 /*return*/, data];
1583
- }); }); }, logout: function () { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1584
- return [2 /*return*/];
1585
- }); }); } }, 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
+ }); }); };
1586
1590
  var authenticate = useWebAuthn().authenticate;
1587
1591
  var authenticator = new camsSdk.CAMSMFAAuthenticator();
1588
- var _j = useOTPHandler({
1592
+ var _h = useOTPHandler({
1589
1593
  email: ((_c = (_b = context.user) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.email) || context.email,
1590
1594
  appCode: context.appCode || "",
1591
1595
  MFAEndpoint: MFAEndpoints.ValidateUserMFA,
@@ -1624,9 +1628,9 @@ var MFAOptions = function (_a) {
1624
1628
  }
1625
1629
  });
1626
1630
  }); },
1627
- }), handleSubmitOTP = _j.handleSubmitOTP, loading = _j.loading,
1631
+ }), handleSubmitOTP = _h.handleSubmitOTP, loading = _h.loading,
1628
1632
  // setLoading,
1629
- 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;
1630
1634
  var handleGoBack = function () {
1631
1635
  setAuthType(null);
1632
1636
  setOtpVisible(false);