From 422136b7bed37ae51b13d99bfc880a36e9da61aa Mon Sep 17 00:00:00 2001 From: Piyush Gupta Date: Tue, 7 Oct 2025 19:01:16 +0530 Subject: [PATCH] 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(); }