@djangocfg/api 2.1.149 → 2.1.150

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
@@ -245,15 +245,6 @@ interface AuthConfig {
245
245
  defaultAuthCallback?: string;
246
246
  };
247
247
  onLogout?: () => void;
248
- onConfirm?: (options: {
249
- title: string;
250
- description: string;
251
- confirmationButtonText: string;
252
- cancellationButtonText: string;
253
- color: string;
254
- }) => Promise<{
255
- confirmed: boolean;
256
- }>;
257
248
  }
258
249
  interface AuthContextType {
259
250
  user: UserProfile | null;
package/dist/auth.d.ts CHANGED
@@ -245,15 +245,6 @@ interface AuthConfig {
245
245
  defaultAuthCallback?: string;
246
246
  };
247
247
  onLogout?: () => void;
248
- onConfirm?: (options: {
249
- title: string;
250
- description: string;
251
- confirmationButtonText: string;
252
- cancellationButtonText: string;
253
- color: string;
254
- }) => Promise<{
255
- confirmed: boolean;
256
- }>;
257
248
  }
258
249
  interface AuthContextType {
259
250
  user: UserProfile | null;
package/dist/auth.mjs CHANGED
@@ -5586,6 +5586,9 @@ var useDeleteAccount = /* @__PURE__ */ __name(() => {
5586
5586
  };
5587
5587
  }, "useDeleteAccount");
5588
5588
 
5589
+ // src/auth/context/AuthContext.tsx
5590
+ import { getT } from "@djangocfg/i18n";
5591
+
5589
5592
  // src/auth/context/AccountsContext.tsx
5590
5593
  import {
5591
5594
  createContext,
@@ -6065,22 +6068,15 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
6065
6068
  performLogout();
6066
6069
  return;
6067
6070
  }
6068
- if (configRef.current?.onConfirm) {
6069
- const { confirmed } = await configRef.current.onConfirm({
6070
- title: "Logout",
6071
- description: "Are you sure you want to logout?",
6072
- confirmationButtonText: "Logout",
6073
- cancellationButtonText: "Cancel",
6074
- color: "error"
6075
- });
6076
- if (confirmed) {
6077
- performLogout();
6078
- }
6079
- } else {
6080
- const confirmed = window.confirm("Are you sure you want to logout?");
6081
- if (confirmed) {
6082
- performLogout();
6083
- }
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"
6077
+ });
6078
+ if (confirmed) {
6079
+ performLogout();
6084
6080
  }
6085
6081
  }, [accounts, config?.routes?.defaultAuthCallback, router]);
6086
6082
  const isAdminUser = useMemo2(() => {