From 422136b7bed37ae51b13d99bfc880a36e9da61aa Mon Sep 17 00:00:00 2001 From: Piyush Gupta Date: Tue, 7 Oct 2025 19:01:16 +0530 Subject: [PATCH 1/2] fix: clear authentication tokens on user deletion --- frontend/src/hooks/api/users/queries.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/hooks/api/users/queries.tsx b/frontend/src/hooks/api/users/queries.tsx index 22d4f39d8..d7623da93 100644 --- a/frontend/src/hooks/api/users/queries.tsx +++ b/frontend/src/hooks/api/users/queries.tsx @@ -1,6 +1,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { AxiosError } from "axios"; +import SecurityClient from "@app/components/utilities/SecurityClient"; import { apiRequest } from "@app/config/request"; import { SessionStorageKeys } from "@app/const"; import { queryClient as qc } from "@app/hooks/api/reactQuery"; @@ -86,6 +87,8 @@ export const useDeleteMe = () => { localStorage.removeItem("tag"); localStorage.removeItem("PRIVATE_KEY"); localStorage.removeItem("orgData.id"); + setAuthToken(""); + SecurityClient.setToken(""); queryClient.clear(); } From b4e2ef8506fe9719fa3b04a0d6e3a413713a152f Mon Sep 17 00:00:00 2001 From: Piyush Gupta Date: Tue, 7 Oct 2025 19:09:07 +0530 Subject: [PATCH 2/2] fix: clears auth token --- frontend/src/hooks/api/users/queries.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/hooks/api/users/queries.tsx b/frontend/src/hooks/api/users/queries.tsx index d7623da93..9c2d00b05 100644 --- a/frontend/src/hooks/api/users/queries.tsx +++ b/frontend/src/hooks/api/users/queries.tsx @@ -1,7 +1,6 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { AxiosError } from "axios"; -import SecurityClient from "@app/components/utilities/SecurityClient"; import { apiRequest } from "@app/config/request"; import { SessionStorageKeys } from "@app/const"; import { queryClient as qc } from "@app/hooks/api/reactQuery"; @@ -87,8 +86,8 @@ export const useDeleteMe = () => { localStorage.removeItem("tag"); localStorage.removeItem("PRIVATE_KEY"); localStorage.removeItem("orgData.id"); + setAuthToken(""); - SecurityClient.setToken(""); queryClient.clear(); }