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

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
@@ -643,32 +643,26 @@ function useCAMSMSALAuth(options) {
643
643
  });
644
644
  }); }, []);
645
645
  var logout = React.useCallback(function () { return __awaiter$1(_this, void 0, void 0, function () {
646
- var err_2, camsError;
646
+ var camsError;
647
647
  return __generator$1(this, function (_a) {
648
- switch (_a.label) {
649
- case 0:
650
- _a.trys.push([0, 2, , 3]);
651
- camsSdk.Logger.info("Logging User Out");
652
- setAccessToken("");
653
- setIdToken("");
654
- setError(null);
655
- setRequiresMFA(false);
656
- setIsAuthenticated(false);
657
- if (typeof window !== "undefined") {
658
- localStorage.removeItem(storageKey);
659
- deleteCookie(storageKey + "-PROFILE");
660
- }
661
- return [4 /*yield*/, instance.logoutRedirect()];
662
- case 1:
663
- _a.sent();
664
- return [3 /*break*/, 3];
665
- case 2:
666
- err_2 = _a.sent();
667
- camsError = new camsSdk.CAMSError(camsSdk.CAMSErrorType.API_VALIDATION_ERROR, "Logout failed: " + err_2);
668
- setError(camsError);
669
- return [3 /*break*/, 3];
670
- case 3: return [2 /*return*/];
648
+ try {
649
+ camsSdk.Logger.info("Logging User Out");
650
+ setAccessToken("");
651
+ setIdToken("");
652
+ setError(null);
653
+ setRequiresMFA(false);
654
+ setIsAuthenticated(false);
655
+ if (typeof window !== "undefined") {
656
+ localStorage.removeItem(storageKey);
657
+ deleteCookie(storageKey + "-PROFILE");
658
+ }
659
+ // await instance.logoutRedirect();
671
660
  }
661
+ catch (err) {
662
+ camsError = new camsSdk.CAMSError(camsSdk.CAMSErrorType.API_VALIDATION_ERROR, "Logout failed: " + err);
663
+ setError(camsError);
664
+ }
665
+ return [2 /*return*/];
672
666
  });
673
667
  }); }, [instance, storageKey]);
674
668
  return {