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

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.
@@ -22,5 +22,5 @@ interface MFAGateProps {
22
22
  }) => void;
23
23
  onAuthError?: (error: any) => void;
24
24
  }
25
- declare const MFAGate: ({ children, fallback, usePassKey, useADLogin, CredentialsAuthEndpoint, PassKeysRegisterProps, MFAEndpoints, requiresMFA, onAuthSuccess, onAuthError, }: MFAGateProps) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
25
+ declare const MFAGate: ({ children, fallback, usePassKey, useADLogin, CredentialsAuthEndpoint, PassKeysRegisterProps, MFAEndpoints, requiresMFA, onAuthSuccess, onAuthError, }: MFAGateProps) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
26
26
  export default MFAGate;
package/dist/index.cjs.js CHANGED
@@ -1868,6 +1868,12 @@ var MFAGate = function (_a) {
1868
1868
  }
1869
1869
  // Small delay to ensure all context updates are processed
1870
1870
  var timer = setTimeout(function () {
1871
+ var _a, _b, _c;
1872
+ camsSdk.Logger.debug("User context:", {
1873
+ user: context.user,
1874
+ profile: (_a = context.user) === null || _a === void 0 ? void 0 : _a.profile,
1875
+ email: (_c = (_b = context.user) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.email,
1876
+ });
1871
1877
  var shouldRequireMFA = requiresMFA !== null && requiresMFA !== void 0 ? requiresMFA : ("requiresMFA" in context ? context.requiresMFA : false);
1872
1878
  var accessToken = "accessToken" in context ? context.accessToken : "";
1873
1879
  if (shouldRequireMFA && accessToken) {
@@ -1891,30 +1897,6 @@ var MFAGate = function (_a) {
1891
1897
  return jsxRuntime.jsx(ErrorFallback, { message: "Invalid MFA Configuration." });
1892
1898
  if (context.authMode !== "MSAL")
1893
1899
  return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children });
1894
- // if (!context.isAuthenticated) {
1895
- // const shouldRequireMFA =
1896
- // requiresMFA ?? ("requiresMFA" in context ? context.requiresMFA : false);
1897
- // const accessToken = "accessToken" in context ? context.accessToken : "";
1898
- // if (shouldRequireMFA && accessToken) {
1899
- // return (
1900
- // <MFAOptions
1901
- // MFAEndpoints={validatedMFAEndpoints}
1902
- // usePassKey={usePassKey}
1903
- // onComplete={handleComplete}
1904
- // onAuthFailed={handleAuthFailed}
1905
- // />
1906
- // );
1907
- // }
1908
- // return (
1909
- // <DefaultLoginPage
1910
- // usePassKey={usePassKey}
1911
- // useADLogin={useADLogin}
1912
- // MFAEndpoints={MFAEndpoints!}
1913
- // PassKeysRegisterProps={PassKeysRegisterProps}
1914
- // CredentialsAuthEndpoint={CredentialsAuthEndpoint}
1915
- // />
1916
- // );
1917
- // }
1918
1900
  switch (authState) {
1919
1901
  case "Loading":
1920
1902
  return fallback;
@@ -1924,7 +1906,7 @@ var MFAGate = function (_a) {
1924
1906
  return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children });
1925
1907
  case "Unauthenticated":
1926
1908
  default:
1927
- jsxRuntime.jsx(DefaultLoginPage, { usePassKey: usePassKey, useADLogin: useADLogin, MFAEndpoints: MFAEndpoints, PassKeysRegisterProps: PassKeysRegisterProps, CredentialsAuthEndpoint: CredentialsAuthEndpoint });
1909
+ return (jsxRuntime.jsx(DefaultLoginPage, { usePassKey: usePassKey, useADLogin: useADLogin, MFAEndpoints: MFAEndpoints, PassKeysRegisterProps: PassKeysRegisterProps, CredentialsAuthEndpoint: CredentialsAuthEndpoint }));
1928
1910
  }
1929
1911
  };
1930
1912