Remove remaining SecurityClient auth calls in favor of hooks, keep RouteGuard

This commit is contained in:
Tuan Dang
2023-08-11 11:27:33 +07:00
parent 2dba7847b6
commit a4edf6bd0c
40 changed files with 443 additions and 910 deletions
+3 -1
View File
@@ -201,7 +201,9 @@ export const useRegisterUserAction = () => {
export const useLogoutUser = () =>
useMutation({
mutationFn: () => apiRequest.post("/api/v1/auth/logout"),
mutationFn: async () => {
await apiRequest.post("/api/v1/auth/logout");
},
onSuccess: () => {
setAuthToken("");
// Delete the cookie by not setting a value; Alternatively clear the local storage