added navigation hook to replace path
This commit is contained in:
parent
3cc4f0b416
commit
0dd7c19457
@ -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();
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user