v3: fixed authorization bug with stale tokens, fixed private dump access bug, various small fixes across the app
Some checks failed
Build and Publish Docker Image / build-and-push (push) Failing after 20s
Some checks failed
Build and Publish Docker Image / build-and-push (push) Failing after 20s
This commit is contained in:
@@ -41,7 +41,9 @@ export const useAuth = () => {
|
||||
...init,
|
||||
headers: {
|
||||
...(init.headers ?? {}),
|
||||
Authorization: `Bearer ${token}`,
|
||||
// Only attach a token when we actually have one — avoids sending a
|
||||
// `Bearer undefined` header that the server would reject as invalid.
|
||||
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
||||
// Let the browser set Content-Type for FormData (it includes the boundary)
|
||||
...(isFormData ? {} : { "Content-Type": "application/json" }),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user