aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/passkey
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-16 13:17:43 -0800
committerAdam Soltys <[email protected]>2026-02-16 13:17:43 -0800
commitac06683100e089ad589661b14ebaf5dc9582a256 (patch)
treef561f90aa09f3a6a3747cd703984043f028f9067 /src/routes/passkey
parente39bf4f977bba2952a7de4a307b14c5ec862a3a7 (diff)
downloadcoinos-ui-ac06683100e089ad589661b14ebaf5dc9582a256.tar.gz
coinos-ui-ac06683100e089ad589661b14ebaf5dc9582a256.zip
passkey tweaks
Diffstat (limited to 'src/routes/passkey')
-rw-r--r--src/routes/passkey/[...path]/+server.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/routes/passkey/[...path]/+server.ts b/src/routes/passkey/[...path]/+server.ts
index 0f94c605..0c2154d2 100644
--- a/src/routes/passkey/[...path]/+server.ts
+++ b/src/routes/passkey/[...path]/+server.ts
@@ -3,9 +3,16 @@ import { auth } from "$lib/utils";
export async function POST({ cookies, fetch, params, request, url }) {
const { path } = params;
- const token = cookies.get("token");
const headers: Record<string, string> = { "Content-Type": "application/json" };
- if (token) Object.assign(headers, auth(cookies));
+
+ // Use Authorization header from request if present, otherwise fall back to cookie
+ const authHeader = request.headers.get("authorization");
+ if (authHeader) {
+ headers.authorization = authHeader;
+ } else {
+ const token = cookies.get("token");
+ if (token) Object.assign(headers, auth(cookies));
+ }
const body = await request.json();
body.origin = url.origin;