diff options
| author | Adam Soltys <[email protected]> | 2025-09-13 22:27:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-09-13 22:27:49 -0700 |
| commit | 17eab850084bc4ac47ebdc4b293beb983ab11df7 (patch) | |
| tree | e85acd556684494c59b7fbad79d4f9025c866837 /src/routes/(app)/pos/+page.server.ts | |
| parent | 3e7f4613c7133b3de17e785b8b8461355ef807c6 (diff) | |
| download | coinos-ui-17eab850084bc4ac47ebdc4b293beb983ab11df7.tar.gz coinos-ui-17eab850084bc4ac47ebdc4b293beb983ab11df7.zip | |
default token
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) }; }, }; |
