diff options
Diffstat (limited to 'src/routes/(app)/pos/+page.server.ts')
| -rw-r--r-- | src/routes/(app)/pos/+page.server.ts | 10 |
1 files changed, 7 insertions, 3 deletions
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) }; }, }; |
