@djangocfg/api 2.1.149 → 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.cjs +9 -32
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -12
- package/dist/auth.d.ts +1 -12
- package/dist/auth.mjs +9 -32
- package/dist/auth.mjs.map +1 -1
- package/package.json +2 -2
- package/src/auth/context/AuthContext.tsx +12 -40
- package/src/auth/context/types.ts +1 -8
package/dist/auth.cjs
CHANGED
|
@@ -6101,38 +6101,15 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
|
|
|
6101
6101
|
};
|
|
6102
6102
|
}
|
|
6103
6103
|
}, [clearAuthState, accounts]);
|
|
6104
|
-
const logout = (0, import_react17.useCallback)(
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
router.hardReplace(authCallbackUrl);
|
|
6114
|
-
}, "performLogout");
|
|
6115
|
-
if (options?.skipConfirm) {
|
|
6116
|
-
performLogout();
|
|
6117
|
-
return;
|
|
6118
|
-
}
|
|
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
|
-
}
|
|
6135
|
-
}
|
|
6104
|
+
const logout = (0, import_react17.useCallback)(() => {
|
|
6105
|
+
Analytics.event("auth_logout" /* AUTH_LOGOUT */, {
|
|
6106
|
+
category: "auth" /* AUTH */
|
|
6107
|
+
});
|
|
6108
|
+
accounts.logout();
|
|
6109
|
+
setInitialized(true);
|
|
6110
|
+
setIsLoading(false);
|
|
6111
|
+
const authCallbackUrl = config?.routes?.defaultAuthCallback || defaultRoutes.defaultAuthCallback;
|
|
6112
|
+
router.hardReplace(authCallbackUrl);
|
|
6136
6113
|
}, [accounts, config?.routes?.defaultAuthCallback, router]);
|
|
6137
6114
|
const isAdminUser = (0, import_react17.useMemo)(() => {
|
|
6138
6115
|
return Boolean(user?.is_staff || user?.is_superuser);
|