@djangocfg/api 2.1.148 → 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.cjs CHANGED
@@ -5644,6 +5644,9 @@ var useDeleteAccount = /* @__PURE__ */ __name(() => {
5644
5644
  };
5645
5645
  }, "useDeleteAccount");
5646
5646
 
5647
+ // src/auth/context/AuthContext.tsx
5648
+ var import_i18n = require("@djangocfg/i18n");
5649
+
5647
5650
  // src/auth/context/AccountsContext.tsx
5648
5651
  var import_react16 = require("react");
5649
5652
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -6116,22 +6119,15 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
6116
6119
  performLogout();
6117
6120
  return;
6118
6121
  }
6119
- if (configRef.current?.onConfirm) {
6120
- const { confirmed } = await configRef.current.onConfirm({
6121
- title: "Logout",
6122
- description: "Are you sure you want to logout?",
6123
- confirmationButtonText: "Logout",
6124
- cancellationButtonText: "Cancel",
6125
- color: "error"
6126
- });
6127
- if (confirmed) {
6128
- performLogout();
6129
- }
6130
- } else {
6131
- const confirmed = window.confirm("Are you sure you want to logout?");
6132
- if (confirmed) {
6133
- performLogout();
6134
- }
6122
+ const confirmed = await window.dialog.confirm({
6123
+ title: (0, import_i18n.getT)("layouts.logout.title"),
6124
+ message: (0, import_i18n.getT)("layouts.logout.message"),
6125
+ confirmText: (0, import_i18n.getT)("layouts.logout.confirm"),
6126
+ cancelText: (0, import_i18n.getT)("layouts.logout.cancel"),
6127
+ variant: "destructive"
6128
+ });
6129
+ if (confirmed) {
6130
+ performLogout();
6135
6131
  }
6136
6132
  }, [accounts, config?.routes?.defaultAuthCallback, router]);
6137
6133
  const isAdminUser = (0, import_react17.useMemo)(() => {