diff options
| author | Adam Soltys <[email protected]> | 2024-12-31 15:21:10 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-12-31 15:21:10 -0800 |
| commit | 62443cf59e0e5b3db94a1873b11eb815cd7829fa (patch) | |
| tree | 9cdcf40cb0672c138aba27e33e730d9fae7b4a3a /src/routes/(static)/register/+page.server.ts | |
| parent | b5015d1161f9cd3e916182e737a1c67186b1cebc (diff) | |
| download | coinos-ui-62443cf59e0e5b3db94a1873b11eb815cd7829fa.tar.gz coinos-ui-62443cf59e0e5b3db94a1873b11eb815cd7829fa.zip | |
nostr sign in
Diffstat (limited to 'src/routes/(static)/register/+page.server.ts')
| -rw-r--r-- | src/routes/(static)/register/+page.server.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/routes/(static)/register/+page.server.ts b/src/routes/(static)/register/+page.server.ts index 4cff0ed9..b459c622 100644 --- a/src/routes/(static)/register/+page.server.ts +++ b/src/routes/(static)/register/+page.server.ts @@ -1,4 +1,4 @@ -import { fd, login, post } from "$lib/utils"; +import { get, fd, login, post } from "$lib/utils"; import { fail, redirect } from "@sveltejs/kit"; export const load = async ({ parent }) => { @@ -6,8 +6,9 @@ export const load = async ({ parent }) => { if (user) redirect(307, `/${user.username}`); const index = Math.floor(Math.random() * 64) + 1; + const { id } = await get("/challenge"); - return { index }; + return { index, id }; }; export const actions = { @@ -23,17 +24,13 @@ export const actions = { if (loginRedirect === "undefined") loginRedirect = undefined; try { - console.log("ST", Date.now()); await post("/register", { user }, { "cf-connecting-ip": ip }); - console.log("END", Date.now()); } catch (e) { ({ message: error } = e as Error); } try { - console.log("ST", Date.now()); await login(user, cookies, ip); - console.log("END", Date.now()); error = null; } catch (e) { const { message } = e as Error; |
