diff --git a/src/components/nav-user.tsx b/src/components/nav-user.tsx index 86342f6..289e30f 100644 --- a/src/components/nav-user.tsx +++ b/src/components/nav-user.tsx @@ -9,6 +9,7 @@ import { Sparkles, } from 'lucide-react'; import { useRouter } from 'next/navigation'; +import { useQueryClient } from '@tanstack/react-query'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { @@ -43,6 +44,7 @@ export function NavUser({ }) { const { isMobile } = useSidebar(); const router = useRouter(); + const queryClient = useQueryClient(); const clearAuth = useAuthStore((state) => state.logout); const clearApp = useAppStore((state) => state.clear); const [isLoggingOut, setIsLoggingOut] = useState(false); @@ -57,6 +59,7 @@ export function NavUser({ } catch { // Local logout should still complete if the server session is already invalid. } finally { + queryClient.clear(); clearAuth(); clearApp(); router.replace(ROUTES.LOGIN);