From 95427ee5189269e992ae4c788ce356709ed92c57 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 16 Feb 2026 16:05:56 -0800 Subject: default accounts --- src/routes/(app)/post/[...path]/+server.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/routes/(app)/post') diff --git a/src/routes/(app)/post/[...path]/+server.ts b/src/routes/(app)/post/[...path]/+server.ts index 244683ee..2c3e6d18 100644 --- a/src/routes/(app)/post/[...path]/+server.ts +++ b/src/routes/(app)/post/[...path]/+server.ts @@ -3,10 +3,18 @@ import { auth } from "$lib/utils"; export async function POST({ cookies, fetch, params, request }) { const { path } = params; + const headers: Record = { "Content-Type": "application/json" }; + + const authHeader = request.headers.get("authorization"); + if (authHeader) { + headers.authorization = authHeader; + } else { + Object.assign(headers, auth(cookies)); + } return fetch(`${base}/${path}`, { method: "POST", body: JSON.stringify(await request.json()), - headers: { "Content-Type": "application/json", ...auth(cookies) }, + headers, }); } -- cgit v1.2.3