@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.esm.js CHANGED
@@ -1555,14 +1555,20 @@ var MFAOptions = function (_a) {
1555
1555
  var _f = useState(false), showSuccessAnimation = _f[0], setShowSuccessAnimation = _f[1];
1556
1556
  var _g = useState(null), authType = _g[0], setAuthType = _g[1];
1557
1557
  var context = useCAMSContext();
1558
- var _h = context.authMode === "MSAL" && "EmailOTP" in context
1559
- ? context
1560
- : { completeMFA: null, logout: function () { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1561
- return [2 /*return*/];
1562
- }); }); } }, completeMFA = _h.completeMFA, logout = _h.logout;
1558
+ // Type-safe extraction of completeMFA and logout
1559
+ var completeMFA = context.authMode === "MSAL"
1560
+ ? context.completeMFA
1561
+ : function (data) { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1562
+ return [2 /*return*/, data];
1563
+ }); }); };
1564
+ var logout = context.authMode === "MSAL"
1565
+ ? context.logout
1566
+ : function () { return __awaiter$1(void 0, void 0, void 0, function () { return __generator$1(this, function (_a) {
1567
+ return [2 /*return*/];
1568
+ }); }); };
1563
1569
  var authenticate = useWebAuthn().authenticate;
1564
1570
  var authenticator = new CAMSMFAAuthenticator();
1565
- var _j = useOTPHandler({
1571
+ var _h = useOTPHandler({
1566
1572
  email: ((_c = (_b = context.user) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.email) || context.email,
1567
1573
  appCode: context.appCode || "",
1568
1574
  MFAEndpoint: MFAEndpoints.ValidateUserMFA,
@@ -1601,9 +1607,9 @@ var MFAOptions = function (_a) {
1601
1607
  }
1602
1608
  });
1603
1609
  }); },
1604
- }), handleSubmitOTP = _j.handleSubmitOTP, loading = _j.loading,
1610
+ }), handleSubmitOTP = _h.handleSubmitOTP, loading = _h.loading,
1605
1611
  // setLoading,
1606
- attemptCount = _j.attemptCount, remainingAttempts = _j.remainingAttempts, isMaxAttemptsReached = _j.isMaxAttemptsReached, resetAttempts = _j.resetAttempts;
1612
+ attemptCount = _h.attemptCount, remainingAttempts = _h.remainingAttempts, isMaxAttemptsReached = _h.isMaxAttemptsReached, resetAttempts = _h.resetAttempts;
1607
1613
  var handleGoBack = function () {
1608
1614
  setAuthType(null);
1609
1615
  setOtpVisible(false);