@djangocfg/api 2.1.366 → 2.1.367

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/auth.d.cts CHANGED
@@ -353,6 +353,8 @@ interface AuthContextType {
353
353
  interface AuthProviderProps {
354
354
  children: React$1.ReactNode;
355
355
  config?: AuthConfig;
356
+ /** Set false to skip all auth logic and render children directly. */
357
+ enabled?: boolean;
356
358
  }
357
359
 
358
360
  /**
@@ -361,7 +363,7 @@ interface AuthProviderProps {
361
363
  * Memoised: re-renders only when `config` reference or `children` change.
362
364
  * Internal auth state is isolated inside AuthProviderInternal.
363
365
  */
364
- declare function AuthProviderRaw({ children, config }: AuthProviderProps): react_jsx_runtime.JSX.Element;
366
+ declare function AuthProviderRaw({ children, config, enabled }: AuthProviderProps): react_jsx_runtime.JSX.Element;
365
367
  declare const AuthProvider: React$1.MemoExoticComponent<typeof AuthProviderRaw>;
366
368
  /**
367
369
  * Hook to access auth context
package/dist/auth.d.ts CHANGED
@@ -353,6 +353,8 @@ interface AuthContextType {
353
353
  interface AuthProviderProps {
354
354
  children: React$1.ReactNode;
355
355
  config?: AuthConfig;
356
+ /** Set false to skip all auth logic and render children directly. */
357
+ enabled?: boolean;
356
358
  }
357
359
 
358
360
  /**
@@ -361,7 +363,7 @@ interface AuthProviderProps {
361
363
  * Memoised: re-renders only when `config` reference or `children` change.
362
364
  * Internal auth state is isolated inside AuthProviderInternal.
363
365
  */
364
- declare function AuthProviderRaw({ children, config }: AuthProviderProps): react_jsx_runtime.JSX.Element;
366
+ declare function AuthProviderRaw({ children, config, enabled }: AuthProviderProps): react_jsx_runtime.JSX.Element;
365
367
  declare const AuthProvider: React$1.MemoExoticComponent<typeof AuthProviderRaw>;
366
368
  /**
367
369
  * Hook to access auth context
package/dist/auth.mjs CHANGED
@@ -4376,7 +4376,7 @@ function useAccountsContext() {
4376
4376
  __name(useAccountsContext, "useAccountsContext");
4377
4377
 
4378
4378
  // src/auth/context/AuthContext.tsx
4379
- import { jsx as jsx2 } from "react/jsx-runtime";
4379
+ import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
4380
4380
  var defaultRoutes = {
4381
4381
  auth: "/auth",
4382
4382
  defaultCallback: "/dashboard",
@@ -4803,7 +4803,8 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
4803
4803
  );
4804
4804
  return /* @__PURE__ */ jsx2(AuthContext.Provider, { value, children: /* @__PURE__ */ jsx2(SWRConfig, { value: swrConfig, children }) });
4805
4805
  }, "AuthProviderInternal");
4806
- function AuthProviderRaw({ children, config }) {
4806
+ function AuthProviderRaw({ children, config, enabled = true }) {
4807
+ if (!enabled) return /* @__PURE__ */ jsx2(Fragment, { children });
4807
4808
  return /* @__PURE__ */ jsx2(AccountsProvider, { children: /* @__PURE__ */ jsx2(AuthProviderInternal, { config, children }) });
4808
4809
  }
4809
4810
  __name(AuthProviderRaw, "AuthProviderRaw");