aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/post
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-16 16:05:56 -0800
committerAdam Soltys <[email protected]>2026-02-16 16:05:56 -0800
commit95427ee5189269e992ae4c788ce356709ed92c57 (patch)
tree675507f470d626a55ff530c8ff76cc4e8df424e0 /src/routes/(app)/post
parentac06683100e089ad589661b14ebaf5dc9582a256 (diff)
downloadcoinos-ui-95427ee5189269e992ae4c788ce356709ed92c57.tar.gz
coinos-ui-95427ee5189269e992ae4c788ce356709ed92c57.zip
default accounts
Diffstat (limited to 'src/routes/(app)/post')
-rw-r--r--src/routes/(app)/post/[...path]/+server.ts10
1 files changed, 9 insertions, 1 deletions
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<string, string> = { "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,
});
}