@nibssplc/cams-sdk-react 1.0.0-rc.73 → 1.0.0-rc.74

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
@@ -1786,13 +1786,14 @@ var MFAEndpointsSchema = z$1.object({
1786
1786
  AuthChallengeVerify: z$1.url("MFA AuthChallengeVerify must be a valid URL"),
1787
1787
  });
1788
1788
  var MFAGate = function (_a) {
1789
- var children = _a.children, _b = _a.fallback, fallback = _b === void 0 ? (jsx("div", { className: "h-screen flex items-center justify-center", children: jsx(LoadingSpinner, {}) })) : _b,
1789
+ var _b, _c, _d;
1790
+ var children = _a.children, _e = _a.fallback, fallback = _e === void 0 ? (jsx("div", { className: "h-screen flex items-center justify-center", children: jsx(LoadingSpinner, {}) })) : _e,
1790
1791
  // loginComponent: LoginComponent = DefaultLoginPage,
1791
- _c = _a.usePassKey,
1792
+ _f = _a.usePassKey,
1792
1793
  // loginComponent: LoginComponent = DefaultLoginPage,
1793
- usePassKey = _c === void 0 ? false : _c, _d = _a.useADLogin, useADLogin = _d === void 0 ? false : _d, CredentialsAuthEndpoint = _a.CredentialsAuthEndpoint, PassKeysRegisterProps = _a.PassKeysRegisterProps, MFAEndpoints = _a.MFAEndpoints, requiresMFA = _a.requiresMFA, onAuthSuccess = _a.onAuthSuccess, onAuthError = _a.onAuthError;
1794
+ usePassKey = _f === void 0 ? false : _f, _g = _a.useADLogin, useADLogin = _g === void 0 ? false : _g, CredentialsAuthEndpoint = _a.CredentialsAuthEndpoint, PassKeysRegisterProps = _a.PassKeysRegisterProps, MFAEndpoints = _a.MFAEndpoints, requiresMFA = _a.requiresMFA, onAuthSuccess = _a.onAuthSuccess, onAuthError = _a.onAuthError;
1794
1795
  var context = useCAMSContext();
1795
- var _e = useState("Loading"), authState = _e[0], setAuthState = _e[1];
1796
+ var _h = useState("Loading"), authState = _h[0], setAuthState = _h[1];
1796
1797
  var validatedMFAEndpoints = useMemo(function () {
1797
1798
  var parsed = MFAEndpointsSchema.safeParse(MFAEndpoints);
1798
1799
  if (!parsed.success) {
@@ -1836,6 +1837,11 @@ var MFAGate = function (_a) {
1836
1837
  }
1837
1838
  });
1838
1839
  }); }, [context, onAuthError]);
1840
+ Logger.debug("User context:", {
1841
+ user: context.user,
1842
+ profile: (_b = context.user) === null || _b === void 0 ? void 0 : _b.profile,
1843
+ email: (_d = (_c = context.user) === null || _c === void 0 ? void 0 : _c.profile) === null || _d === void 0 ? void 0 : _d.email,
1844
+ });
1839
1845
  useEffect(function () {
1840
1846
  if (context.isLoading) {
1841
1847
  setAuthState("Loading");
@@ -1847,12 +1853,6 @@ var MFAGate = function (_a) {
1847
1853
  }
1848
1854
  // Small delay to ensure all context updates are processed
1849
1855
  var timer = setTimeout(function () {
1850
- var _a, _b, _c;
1851
- Logger.debug("User context:", {
1852
- user: context.user,
1853
- profile: (_a = context.user) === null || _a === void 0 ? void 0 : _a.profile,
1854
- email: (_c = (_b = context.user) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.email,
1855
- });
1856
1856
  var shouldRequireMFA = requiresMFA !== null && requiresMFA !== void 0 ? requiresMFA : ("requiresMFA" in context ? context.requiresMFA : false);
1857
1857
  var accessToken = "accessToken" in context ? context.accessToken : "";
1858
1858
  if (shouldRequireMFA && accessToken) {