added navigation hook to replace path

This commit is contained in:
pramod.mahajan 2025-10-10 15:37:59 +05:30
parent 3cc4f0b416
commit 0dd7c19457

View File

@ -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();
},