vibe coded v1

This commit is contained in:
khannurien
2026-03-16 07:34:49 +00:00
parent 6207a7549f
commit e88fed4e98
48 changed files with 4303 additions and 595 deletions

View File

@@ -19,13 +19,15 @@ export const useAuth = () => {
const authFetch = async (input: RequestInfo, init: RequestInit = {}) => {
const token = authResponse?.token;
const isFormData = init.body instanceof FormData;
const res = await fetch(input, {
...init,
headers: {
...(init.headers ?? {}),
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
// Let the browser set Content-Type for FormData (it includes the boundary)
...(isFormData ? {} : { "Content-Type": "application/json" }),
},
});