@djangocfg/api 2.1.150 → 2.1.151

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
@@ -277,9 +277,7 @@ interface AuthContextType {
277
277
  success: boolean;
278
278
  message: string;
279
279
  }>;
280
- logout: (options?: {
281
- skipConfirm?: boolean;
282
- }) => Promise<void>;
280
+ logout: () => void;
283
281
  saveRedirectUrl: (url: string) => void;
284
282
  getRedirectUrl: () => string;
285
283
  clearRedirectUrl: () => void;
package/dist/auth.d.ts CHANGED
@@ -277,9 +277,7 @@ interface AuthContextType {
277
277
  success: boolean;
278
278
  message: string;
279
279
  }>;
280
- logout: (options?: {
281
- skipConfirm?: boolean;
282
- }) => Promise<void>;
280
+ logout: () => void;
283
281
  saveRedirectUrl: (url: string) => void;
284
282
  getRedirectUrl: () => string;
285
283
  clearRedirectUrl: () => void;
package/dist/auth.mjs CHANGED
@@ -5586,9 +5586,6 @@ var useDeleteAccount = /* @__PURE__ */ __name(() => {
5586
5586
  };
5587
5587
  }, "useDeleteAccount");
5588
5588
 
5589
- // src/auth/context/AuthContext.tsx
5590
- import { getT } from "@djangocfg/i18n";
5591
-
5592
5589
  // src/auth/context/AccountsContext.tsx
5593
5590
  import {
5594
5591
  createContext,
@@ -6053,31 +6050,15 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
6053
6050
  };
6054
6051
  }
6055
6052
  }, [clearAuthState, accounts]);
6056
- const logout = useCallback12(async (options) => {
6057
- const performLogout = /* @__PURE__ */ __name(() => {
6058
- Analytics.event("auth_logout" /* AUTH_LOGOUT */, {
6059
- category: "auth" /* AUTH */
6060
- });
6061
- accounts.logout();
6062
- setInitialized(true);
6063
- setIsLoading(false);
6064
- const authCallbackUrl = config?.routes?.defaultAuthCallback || defaultRoutes.defaultAuthCallback;
6065
- router.hardReplace(authCallbackUrl);
6066
- }, "performLogout");
6067
- if (options?.skipConfirm) {
6068
- performLogout();
6069
- return;
6070
- }
6071
- const confirmed = await window.dialog.confirm({
6072
- title: getT("layouts.logout.title"),
6073
- message: getT("layouts.logout.message"),
6074
- confirmText: getT("layouts.logout.confirm"),
6075
- cancelText: getT("layouts.logout.cancel"),
6076
- variant: "destructive"
6053
+ const logout = useCallback12(() => {
6054
+ Analytics.event("auth_logout" /* AUTH_LOGOUT */, {
6055
+ category: "auth" /* AUTH */
6077
6056
  });
6078
- if (confirmed) {
6079
- performLogout();
6080
- }
6057
+ accounts.logout();
6058
+ setInitialized(true);
6059
+ setIsLoading(false);
6060
+ const authCallbackUrl = config?.routes?.defaultAuthCallback || defaultRoutes.defaultAuthCallback;
6061
+ router.hardReplace(authCallbackUrl);
6081
6062
  }, [accounts, config?.routes?.defaultAuthCallback, router]);
6082
6063
  const isAdminUser = useMemo2(() => {
6083
6064
  return Boolean(user?.is_staff || user?.is_superuser);