Browse Source

fix: Use correct OAuth token and headers in Google Drive file upload

Taylor Wilsdon (aider) 4 months ago
parent
commit
f4f8334153

+ 1 - 3
src/lib/components/chat/MessageInput.svelte

@@ -530,9 +530,7 @@
 														id: fileData.id,
 														name: fileData.name,
 														url: fileData.url,
-														headers: {
-															Authorization: 'Bearer [REDACTED]'
-														}
+														headers: fileData.headers // Use the actual headers from the picker
 													});
 													const uploadEvent = { 
 														type: 'google-drive', 

+ 2 - 2
src/lib/utils/google-drive-picker.ts

@@ -130,8 +130,8 @@ export const createPicker = () => {
                             name: fileName,
                             url: downloadUrl,
                             headers: {
-                                'Authorization': `Bearer ${oauthToken}`,
-                                'Content-Type': 'application/json'
+                                'Authorization': `Bearer ${token}`, // Use the current valid token
+                                'Accept': 'application/json'
                             }
                         };
                         console.log('Resolving picker with:', result);