@nibssplc/cams-sdk-react 1.0.0-rc.15 → 1.0.0-rc.16

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
@@ -492,6 +492,10 @@ function useCAMSMSALAuth(options) {
492
492
  return __generator$1(this, function (_e) {
493
493
  switch (_e.label) {
494
494
  case 0:
495
+ if (inProgress !== msalBrowser.InteractionStatus.None) {
496
+ camsSdk.Logger.warn("Authentication already in progress, ignoring duplicate call");
497
+ return [2 /*return*/];
498
+ }
495
499
  setError(null);
496
500
  _e.label = 1;
497
501
  case 1:
@@ -531,6 +535,11 @@ function useCAMSMSALAuth(options) {
531
535
  return [3 /*break*/, 4];
532
536
  case 3:
533
537
  err_1 = _e.sent();
538
+ // Handle interaction_in_progress error
539
+ if (err_1.errorCode === "interaction_in_progress") {
540
+ camsSdk.Logger.warn("Interaction already in progress, please wait");
541
+ return [2 /*return*/];
542
+ }
534
543
  // Handle user cancellation gracefully
535
544
  if (err_1.errorCode === "user_cancelled") {
536
545
  camsSdk.Logger.error("User cancelled login");
@@ -552,7 +561,7 @@ function useCAMSMSALAuth(options) {
552
561
  case 4: return [2 /*return*/];
553
562
  }
554
563
  });
555
- }); }, [instance, scopes, options]);
564
+ }); }, [instance, scopes, options, inProgress]);
556
565
  var completeMFA = React.useCallback(function (data) { return __awaiter$1(_this, void 0, void 0, function () {
557
566
  return __generator$1(this, function (_a) {
558
567
  if (!mfaAuthenticator) {