clear fully cache after remove session
This commit is contained in:
parent
f7f4b68997
commit
aca2decb00
@ -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})
|
||||
|
Loading…
x
Reference in New Issue
Block a user