From e39bf4f977bba2952a7de4a307b14c5ec862a3a7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 16 Feb 2026 11:51:25 -0800 Subject: passkey auth --- src/routes/passkey/[...path]/+server.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/routes/passkey/[...path]/+server.ts (limited to 'src/routes/passkey') diff --git a/src/routes/passkey/[...path]/+server.ts b/src/routes/passkey/[...path]/+server.ts new file mode 100644 index 00000000..0f94c605 --- /dev/null +++ b/src/routes/passkey/[...path]/+server.ts @@ -0,0 +1,18 @@ +import { PUBLIC_COINOS_URL as base } from "$env/static/public"; +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 = { "Content-Type": "application/json" }; + if (token) Object.assign(headers, auth(cookies)); + + const body = await request.json(); + body.origin = url.origin; + + return fetch(`${base}/passkey/${path}`, { + method: "POST", + body: JSON.stringify(body), + headers, + }); +} -- cgit v1.2.3