diff --git a/frontend/src/plugins/api.js b/frontend/src/plugins/api.js index d823b7f..76a5bdd 100644 --- a/frontend/src/plugins/api.js +++ b/frontend/src/plugins/api.js @@ -24,9 +24,17 @@ export function useClient() { } } + // Add authorization header if authenticated if (authStore.isAuthenticated) { 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; });