clear fully cache after remove session
This commit is contained in:
parent
f7f4b68997
commit
aca2decb00
@ -16,6 +16,7 @@ import {
|
|||||||
toggleModal,
|
toggleModal,
|
||||||
} from "../slices/localVariablesSlice.jsx";
|
} from "../slices/localVariablesSlice.jsx";
|
||||||
import { removeSession } from "../utils/authUtils.js";
|
import { removeSession } from "../utils/authUtils.js";
|
||||||
|
import { cacheProfileData } from "../slices/apiDataManager.jsx";
|
||||||
|
|
||||||
// ----------------------------Modal--------------------------
|
// ----------------------------Modal--------------------------
|
||||||
|
|
||||||
@ -85,6 +86,7 @@ export const useAuthModal = () => {
|
|||||||
export const useLogout = () => {
|
export const useLogout = () => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const naviget = useNavigate()
|
const naviget = useNavigate()
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: async () => {
|
mutationFn: async () => {
|
||||||
@ -99,6 +101,7 @@ export const useLogout = () => {
|
|||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
queryClient.clear()
|
queryClient.clear()
|
||||||
removeSession();
|
removeSession();
|
||||||
|
dispatch(cacheProfileData(null))
|
||||||
|
|
||||||
// window.location.href = "/auth/login";
|
// window.location.href = "/auth/login";
|
||||||
naviget("/auth/login",{replace:true})
|
naviget("/auth/login",{replace:true})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user