account auth cleanup
This commit is contained in:
parent
6162722c87
commit
94de501a49
5 changed files with 41 additions and 22 deletions
|
|
@ -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(() => ({}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue