This commit is contained in:
Yassine 2025-06-26 09:00:54 +01:00 committed by GitHub
commit 8cffe5c264
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@ import { useSocket } from "@/websocket/socket-hooks";
import { useFind } from "../crud/useFind";
import { useApiClient } from "../useApiClient";
import { CURRENT_USER_KEY, useAuth, useLogoutRedirection } from "../useAuth";
import { useAuth, useLogoutRedirection } from "../useAuth";
import { useToast } from "../useToast";
import { useTranslate } from "../useTranslate";
@ -74,7 +74,7 @@ export const useLogout = (
return await apiClient.logout();
},
onSuccess: async () => {
queryClient.removeQueries([CURRENT_USER_KEY]);
queryClient.clear();
postMessage({ event: "logout" });
await logoutRedirection();
toast.success(t("message.logout_success"));