From 42fe8e206771b61d6b4ef8a86648902581b00ab6 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Fri, 16 Jan 2026 13:55:11 -0700 Subject: [PATCH] Add auth header to upload --- hooks/useGame.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hooks/useGame.ts b/hooks/useGame.ts index f445285..5f0793b 100644 --- a/hooks/useGame.ts +++ b/hooks/useGame.ts @@ -618,12 +618,19 @@ export const useGame = () => { }, []); const uploadDocument = async (file: File, useOcr: boolean = false): Promise => { + if (!auth.user?.access_token) { + throw new Error('Authentication required to upload documents'); + } + const formData = new FormData(); formData.append('document', file); formData.append('useOcr', String(useOcr)); const response = await fetch(`${BACKEND_URL}/api/upload`, { method: 'POST', + headers: { + 'Authorization': `Bearer ${auth.user.access_token}`, + }, body: formData });