diff --git a/src/hooks/useAuth.jsx b/src/hooks/useAuth.jsx index c52854f4..5b6621e9 100644 --- a/src/hooks/useAuth.jsx +++ b/src/hooks/useAuth.jsx @@ -84,6 +84,7 @@ export const useAuthModal = () => { export const useLogout = () => { const queryClient = useQueryClient(); + const naviget = useNavigate() return useMutation({ mutationFn: async () => { @@ -96,9 +97,11 @@ export const useLogout = () => { }, onSuccess: (data) => { + queryClient.clear() removeSession(); - window.location.href = "/auth/login"; + // window.location.href = "/auth/login"; + naviget("/auth/login",{replace:true}) if (onSuccessCallBack) onSuccessCallBack(); },