Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/api/stt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ describe('WAV extension selection logic', () => {
expect.objectContaining({
method: 'POST',
body: expect.any(FormData),
credentials: 'include',
})
)

Expand Down
1 change: 1 addition & 0 deletions frontend/src/api/stt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const sttApi = {

try {
const response = await fetch(urlObj.toString(), {
credentials: 'include',
method: 'POST',
body: formData,
signal: controller.signal,
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/components/file-browser/FileBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ useEffect(() => {
setError(null)

try {
const response = await fetch(getFileApiUrl(path))
const response = await fetch(getFileApiUrl(path), { credentials: 'include' })
if (!response.ok) {
throw new Error(`Failed to load files: ${response.statusText}`)
}
Expand Down Expand Up @@ -251,7 +251,7 @@ useEffect(() => {
// Fetch the full file content when selecting a file
setLoading(true)
try {
const response = await fetch(getFileApiUrl(file.path))
const response = await fetch(getFileApiUrl(file.path), { credentials: 'include' })
if (!response.ok) {
throw new Error(`Failed to load file: ${response.statusText}`)
}
Expand Down Expand Up @@ -294,6 +294,7 @@ useEffect(() => {

try {
const response = await fetch(getFileApiUrl(currentPath), {
credentials: 'include',
method: 'POST',
body: formData,
})
Expand Down Expand Up @@ -364,6 +365,7 @@ useEffect(() => {
const handleCreateFile = useCallback(async (name: string, type: 'file' | 'folder') => {
try {
const response = await fetch(getFileApiUrl([currentPath, name].filter(Boolean).join('/')), {
credentials: 'include',
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ type, content: type === 'file' ? '' : undefined }),
Expand All @@ -382,6 +384,7 @@ useEffect(() => {
const handleDelete = useCallback(async (path: string) => {
try {
const response = await fetch(getFileApiUrl(path), {
credentials: 'include',
method: 'DELETE',
})

Expand All @@ -399,6 +402,7 @@ useEffect(() => {
const handleRename = useCallback(async (oldPath: string, newPath: string) => {
try {
const response = await fetch(getFileApiUrl(oldPath), {
credentials: 'include',
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ newPath }),
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/file-browser/FilePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const FilePreview = memo(function FilePreview({ file, hideHeader = false,

const saveFileContent = useCallback(async (content: string) => {
const response = await fetch(getFileApiUrl(file.path), {
credentials: 'include',
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'file', content }),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/contexts/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
useEffect(() => {
const fetchConfig = async () => {
try {
const response = await fetch('/api/auth-info/config')
const response = await fetch('/api/auth-info/config', { credentials: 'include' })
if (response.ok) {
const data = await response.json()
setConfig(data)
Expand Down
1 change: 1 addition & 0 deletions frontend/src/contexts/TTSContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export function TTSProvider({ children }: TTSProviderProps) {

try {
const response = await fetch(`${API_BASE_URL}/api/tts/synthesize`, {
credentials: 'include',
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text }),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/auth-loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function fetchAuthConfig(): Promise<AuthConfig> {
isFirstUser: false,
adminConfigured: false,
}
const response = await fetch('/api/auth-info/config')
const response = await fetch('/api/auth-info/config', { credentials: 'include' })
if (!response.ok) {
return defaultConfig
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/opencode-event-stream/browserTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function createBrowserEventStreamTransport(): EventStreamTransport {

async post(path: string, body: unknown): Promise<boolean> {
const response = await fetch(path, {
credentials: 'include',
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
Expand Down