diff options
| author | Adam Soltys <[email protected]> | 2025-10-01 08:59:30 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-10-01 08:59:30 -0700 |
| commit | 8f44a8e8f1dc1b17bdf3edf534c32c04aaa5e2d6 (patch) | |
| tree | 833630649cf32cfaca2e19585bd8e9e47ba43b94 /src | |
| parent | def5d5fa713c45d9cfcc849f1f39702342776788 (diff) | |
| download | coinos-ui-8f44a8e8f1dc1b17bdf3edf534c32c04aaa5e2d6.tar.gz coinos-ui-8f44a8e8f1dc1b17bdf3edf534c32c04aaa5e2d6.zip | |
register challenge
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/(static)/register/+page.server.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/routes/(static)/register/+page.server.ts b/src/routes/(static)/register/+page.server.ts index 284c5a61..47ff8d27 100644 --- a/src/routes/(static)/register/+page.server.ts +++ b/src/routes/(static)/register/+page.server.ts @@ -1,5 +1,4 @@ -import { randomUUID } from "crypto"; -import { fd, get, captchas, register } from "$lib/utils"; +import { fd, get, register } from "$lib/utils"; import { redirect } from "@sveltejs/kit"; export const load = async ({ parent }) => { @@ -9,10 +8,6 @@ export const load = async ({ parent }) => { const index = Math.floor(Math.random() * 64) + 1; const { challenge } = await get("/challenge"); - const captcha = randomUUID(); - captchas.add(captcha); - setTimeout(() => captchas.delete(captcha), 120000); - return { index, challenge }; }; @@ -20,11 +15,11 @@ export const actions = { default: async ({ cookies, request }) => { const ip = request.headers.get("cf-connecting-ip"); const form = await fd(request); - const { picture, username, password } = form; + const { picture, username, password, challenge } = form; let { loginRedirect } = form; if (loginRedirect === "undefined") loginRedirect = undefined; - const user = { picture, username, password }; + const user = { picture, username, password, challenge }; return register(user, ip, cookies, loginRedirect); }, }; |
