From aca2decb00b2d536fe791e6a02db46de8332646a Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Sat, 11 Oct 2025 16:26:04 +0530 Subject: [PATCH] clear fully cache after remove session --- src/hooks/useAuth.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hooks/useAuth.jsx b/src/hooks/useAuth.jsx index 5b6621e9..c9e763f9 100644 --- a/src/hooks/useAuth.jsx +++ b/src/hooks/useAuth.jsx @@ -16,6 +16,7 @@ import { toggleModal, } from "../slices/localVariablesSlice.jsx"; import { removeSession } from "../utils/authUtils.js"; +import { cacheProfileData } from "../slices/apiDataManager.jsx"; // ----------------------------Modal-------------------------- @@ -85,6 +86,7 @@ export const useAuthModal = () => { export const useLogout = () => { const queryClient = useQueryClient(); const naviget = useNavigate() + const dispatch = useDispatch() return useMutation({ mutationFn: async () => { @@ -99,6 +101,7 @@ export const useLogout = () => { onSuccess: (data) => { queryClient.clear() removeSession(); + dispatch(cacheProfileData(null)) // window.location.href = "/auth/login"; naviget("/auth/login",{replace:true})