From 5b458624745c7ea80d1e63c9a6ef77075763ff5f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 10 Jul 2025 12:36:50 -0700 Subject: user onboarding --- src/routes/(app)/fund/[id]/sweep/+page.server.ts | 10 +++++++--- src/routes/(app)/fund/[id]/sweep/+page.svelte | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/routes/(app)/fund') diff --git a/src/routes/(app)/fund/[id]/sweep/+page.server.ts b/src/routes/(app)/fund/[id]/sweep/+page.server.ts index 3e0b8dad..d8415ca4 100644 --- a/src/routes/(app)/fund/[id]/sweep/+page.server.ts +++ b/src/routes/(app)/fund/[id]/sweep/+page.server.ts @@ -10,18 +10,22 @@ export async function load({ cookies, request, params, parent }) { const rates = await getRates(); const rate = rates[user?.currency || "USD"]; + const username = randomName(); + const password = randomPassword(); + if (!amount) redirect(307, `/fund/${id}`); if (!user) { const ip = request.headers.get("cf-connecting-ip"); user = { - username: randomName(), - password: randomPassword(), + username, + password, + fresh: true, }; await register(user, ip, cookies, `/fund/${id}/sweep`); } await post("/take", { amount, id }, auth(cookies)); - return { amount, id, rate, rates }; + return { amount, id, rate, rates, password }; } diff --git a/src/routes/(app)/fund/[id]/sweep/+page.svelte b/src/routes/(app)/fund/[id]/sweep/+page.svelte index 986a84bb..adba77ae 100644 --- a/src/routes/(app)/fund/[id]/sweep/+page.svelte +++ b/src/routes/(app)/fund/[id]/sweep/+page.svelte @@ -1,4 +1,6 @@
-- cgit v1.2.3