From 17eab850084bc4ac47ebdc4b293beb983ab11df7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 13 Sep 2025 22:27:49 -0700 Subject: default token --- src/routes/(app)/pos/+page.server.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/routes/(app)/pos/+page.server.ts') diff --git a/src/routes/(app)/pos/+page.server.ts b/src/routes/(app)/pos/+page.server.ts index f7a3fda3..59f2d923 100644 --- a/src/routes/(app)/pos/+page.server.ts +++ b/src/routes/(app)/pos/+page.server.ts @@ -1,11 +1,15 @@ import { PUBLIC_COINOS_URL } from "$env/static/public"; -import { fd } from "$lib/utils"; +import { auth, fd, get } from "$lib/utils"; import { hex } from "@scure/base"; +export async function load({ cookies }) { + const token = await get("/ro", auth(cookies)); + return { token }; +} + export const actions = { default: async ({ fetch, request }) => { const body = await fd(request); - console.log("POSTING", body); const res = await fetch(`${PUBLIC_COINOS_URL}/flash`, { method: "POST", body: JSON.stringify(body), @@ -16,6 +20,6 @@ export const actions = { }); const buf = new Uint8Array(await res.arrayBuffer()); - return { data: hex.encode(buf) }; + return { bytes: hex.encode(buf) }; }, }; -- cgit v1.2.3