@djangocfg/api 2.1.150 → 2.1.152
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 +8 -27
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -3
- package/dist/auth.d.ts +1 -3
- package/dist/auth.mjs +8 -27
- package/dist/auth.mjs.map +1 -1
- package/package.json +2 -3
- package/src/auth/context/AuthContext.tsx +12 -33
- package/src/auth/context/types.ts +1 -1
package/dist/auth.cjs
CHANGED
|
@@ -5644,9 +5644,6 @@ 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
|
-
|
|
5650
5647
|
// src/auth/context/AccountsContext.tsx
|
|
5651
5648
|
var import_react16 = require("react");
|
|
5652
5649
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -6104,31 +6101,15 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
|
|
|
6104
6101
|
};
|
|
6105
6102
|
}
|
|
6106
6103
|
}, [clearAuthState, accounts]);
|
|
6107
|
-
const logout = (0, import_react17.useCallback)(
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
category: "auth" /* AUTH */
|
|
6111
|
-
});
|
|
6112
|
-
accounts.logout();
|
|
6113
|
-
setInitialized(true);
|
|
6114
|
-
setIsLoading(false);
|
|
6115
|
-
const authCallbackUrl = config?.routes?.defaultAuthCallback || defaultRoutes.defaultAuthCallback;
|
|
6116
|
-
router.hardReplace(authCallbackUrl);
|
|
6117
|
-
}, "performLogout");
|
|
6118
|
-
if (options?.skipConfirm) {
|
|
6119
|
-
performLogout();
|
|
6120
|
-
return;
|
|
6121
|
-
}
|
|
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"
|
|
6104
|
+
const logout = (0, import_react17.useCallback)(() => {
|
|
6105
|
+
Analytics.event("auth_logout" /* AUTH_LOGOUT */, {
|
|
6106
|
+
category: "auth" /* AUTH */
|
|
6128
6107
|
});
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6108
|
+
accounts.logout();
|
|
6109
|
+
setInitialized(true);
|
|
6110
|
+
setIsLoading(false);
|
|
6111
|
+
const authCallbackUrl = config?.routes?.defaultAuthCallback || defaultRoutes.defaultAuthCallback;
|
|
6112
|
+
router.hardReplace(authCallbackUrl);
|
|
6132
6113
|
}, [accounts, config?.routes?.defaultAuthCallback, router]);
|
|
6133
6114
|
const isAdminUser = (0, import_react17.useMemo)(() => {
|
|
6134
6115
|
return Boolean(user?.is_staff || user?.is_superuser);
|