account auth cleanup

This commit is contained in:
makearmy 2025-09-30 17:04:37 -04:00
parent 6162722c87
commit 94de501a49
5 changed files with 41 additions and 22 deletions

View file

@ -30,7 +30,7 @@ export async function POST(req: Request) {
const r1 = await fetch(`${API}/files`, {
method: "POST",
headers: { Authorization: bearer },
headers: { Authorization: `Bearer ${bearer}` },
body: up,
});
const j1 = await r1.json().catch(() => ({}));
@ -43,7 +43,7 @@ export async function POST(req: Request) {
// Link file to the current user
const r2 = await fetch(`${API}/users/me`, {
method: "PATCH",
headers: { Authorization: bearer, "Content-Type": "application/json" },
headers: { Authorization: `Bearer ${bearer}`, "Content-Type": "application/json" },
body: JSON.stringify({ avatar: fileId }),
});
const j2 = await r2.json().catch(() => ({}));