From 0dd7c19457fb9a9f4a0c9ebfd022c8f8fff633ce Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Fri, 10 Oct 2025 15:37:59 +0530 Subject: [PATCH] added navigation hook to replace path --- src/hooks/useAuth.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); },