diff options
| author | YurenHao0426 <blackhao0426@gmail.com> | 2026-02-13 18:35:13 +0000 |
|---|---|---|
| committer | YurenHao0426 <blackhao0426@gmail.com> | 2026-02-13 18:35:13 +0000 |
| commit | 2137e76e9dfcc13a2fcb1753844762cc4b99582a (patch) | |
| tree | 9931fbd0d0e1eb8b08d26198dd18470eb2ad3eee | |
| parent | fe5f0842bddb68ccb9862d86fd255af2694a8b52 (diff) | |
Add auth headers to file upload/delete requests
The frontend upload and delete file fetch calls were missing auth
headers, so the backend could not resolve user-specific API keys.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| -rw-r--r-- | frontend/src/store/flowStore.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/frontend/src/store/flowStore.ts b/frontend/src/store/flowStore.ts index 6140339..3dac19f 100644 --- a/frontend/src/store/flowStore.ts +++ b/frontend/src/store/flowStore.ts @@ -1790,6 +1790,7 @@ const useFlowStore = create<FlowState>((set, get) => { try { const res = await fetch(`${API_BASE}/api/files/upload?user=${encodeURIComponent(getCurrentUser())}`, { method: 'POST', + headers: { ...getAuthHeaders() }, body: form, }); if (!res.ok) { @@ -1809,6 +1810,7 @@ const useFlowStore = create<FlowState>((set, get) => { deleteFile: async (fileId: string) => { const res = await fetch(`${API_BASE}/api/files/delete?user=${encodeURIComponent(getCurrentUser())}&file_id=${encodeURIComponent(fileId)}`, { method: 'POST', + headers: { ...getAuthHeaders() }, }); if (!res.ok) { throw new Error(await res.text()); |
