fix(panels):use session aware asset requests

This commit is contained in:
Anish Sarkar 2026-06-24 03:55:41 +05:30
parent b4328cd52b
commit 6e4d2eb076
4 changed files with 4 additions and 16 deletions

View file

@ -33,7 +33,7 @@ import { Separator } from "@/components/ui/separator";
import { Spinner } from "@/components/ui/spinner";
import { useMediaQuery } from "@/hooks/use-media-query";
import { useElectronAPI } from "@/hooks/use-platform";
import { authenticatedFetch, getBearerToken, redirectToLogin } from "@/lib/auth-utils";
import { authenticatedFetch } from "@/lib/auth-fetch";
import { inferMonacoLanguageFromPath } from "@/lib/editor-language";
import { buildBackendUrl } from "@/lib/env-config";
@ -274,12 +274,6 @@ export function EditorPanelContent({
if (!documentId || !searchSpaceId) {
throw new Error("Missing document context");
}
const token = getBearerToken();
if (!token) {
redirectToLogin();
return;
}
const response = await authenticatedFetch(
buildBackendUrl(
`/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/editor-content`
@ -417,12 +411,6 @@ export function EditorPanelContent({
if (!searchSpaceId || !documentId) {
throw new Error("Missing document context");
}
const token = getBearerToken();
if (!token) {
toast.error("Please login to save");
redirectToLogin();
return;
}
const response = await authenticatedFetch(
buildBackendUrl(`/api/v1/search-spaces/${searchSpaceId}/documents/${documentId}/save`),
{

View file

@ -1,6 +1,6 @@
"use client";
import { authenticatedFetch } from "@/lib/auth-utils";
import { authenticatedFetch } from "@/lib/auth-fetch";
import { buildBackendUrl } from "@/lib/env-config";
export type MemoryScope = "user" | "team";