From afbf448f88a0268f65ddcf0211beeb701f5549e3 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Mon, 23 Feb 2026 22:08:35 +0200 Subject: [PATCH] pass thread_id in reauth request from trash-file card --- .../components/tool-ui/google-drive/trash-file.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/surfsense_web/components/tool-ui/google-drive/trash-file.tsx b/surfsense_web/components/tool-ui/google-drive/trash-file.tsx index 1742326b2..2053356a4 100644 --- a/surfsense_web/components/tool-ui/google-drive/trash-file.tsx +++ b/surfsense_web/components/tool-ui/google-drive/trash-file.tsx @@ -281,15 +281,18 @@ function ApprovalCard({ function InsufficientPermissionsCard({ result }: { result: InsufficientPermissionsResult }) { const params = useParams(); const searchSpaceId = params.search_space_id as string; + const threadId = (params.chat_id as string[] | undefined)?.[0]; const [loading, setLoading] = useState(false); async function handleReauth() { setLoading(true); try { const backendUrl = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000"; - const response = await authenticatedFetch( - `${backendUrl}/api/v1/auth/google/drive/connector/reauth?connector_id=${result.connector_id}&space_id=${searchSpaceId}` - ); + const url = new URL(`${backendUrl}/api/v1/auth/google/drive/connector/reauth`); + url.searchParams.set("connector_id", String(result.connector_id)); + url.searchParams.set("space_id", searchSpaceId); + if (threadId) url.searchParams.set("thread_id", threadId); + const response = await authenticatedFetch(url.toString()); const data = await response.json(); if (data.auth_url) { window.location.href = data.auth_url;