clear fully cache after remove session

This commit is contained in:
pramod.mahajan 2025-10-11 16:26:04 +05:30
parent f7f4b68997
commit aca2decb00

View File

@ -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})