diff --git a/src/lib/lemmy.ts b/src/lib/lemmy.ts index 2a723e34..b84aa4e3 100644 --- a/src/lib/lemmy.ts +++ b/src/lib/lemmy.ts @@ -34,6 +34,12 @@ async function customFetch( ): Promise { const f = func ? func : fetch + if (init) + init.headers = { + ...init.headers, + ...(auth ? { authorization: `Bearer ${auth}` } : {}), + } + if (init?.body && auth) { try { const json = JSON.parse(init.body.toString())