mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
pass thread_id in reauth request from trash-file card
This commit is contained in:
parent
b7e0209453
commit
afbf448f88
1 changed files with 6 additions and 3 deletions
|
|
@ -281,15 +281,18 @@ function ApprovalCard({
|
||||||
function InsufficientPermissionsCard({ result }: { result: InsufficientPermissionsResult }) {
|
function InsufficientPermissionsCard({ result }: { result: InsufficientPermissionsResult }) {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const searchSpaceId = params.search_space_id as string;
|
const searchSpaceId = params.search_space_id as string;
|
||||||
|
const threadId = (params.chat_id as string[] | undefined)?.[0];
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
async function handleReauth() {
|
async function handleReauth() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const backendUrl = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000";
|
const backendUrl = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000";
|
||||||
const response = await authenticatedFetch(
|
const url = new URL(`${backendUrl}/api/v1/auth/google/drive/connector/reauth`);
|
||||||
`${backendUrl}/api/v1/auth/google/drive/connector/reauth?connector_id=${result.connector_id}&space_id=${searchSpaceId}`
|
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();
|
const data = await response.json();
|
||||||
if (data.auth_url) {
|
if (data.auth_url) {
|
||||||
window.location.href = data.auth_url;
|
window.location.href = data.auth_url;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue