Fix uploads

This commit is contained in:
2025-04-17 05:01:50 -04:00
parent 16ae68a02e
commit 685a758f53

View File

@@ -24,9 +24,17 @@ export function useClient() {
} }
} }
// Add authorization header if authenticated
if (authStore.isAuthenticated) { if (authStore.isAuthenticated) {
config.headers.Authorization = `Bearer ${authStore.accessToken}`; config.headers.Authorization = `Bearer ${authStore.accessToken}`;
} }
// Don't override Content-Type for FormData requests
if (config.data instanceof FormData) {
// Let the browser set the correct Content-Type with boundary
delete config.headers['Content-Type'];
}
return config; return config;
}); });