From f24ec95a246ab38bb3253425fd8446dd93176fe9 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 25 Jul 2025 19:35:17 -0700 Subject: authorizations --- src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts index 8a8e71ee..d0e49fcc 100644 --- a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts +++ b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts @@ -36,10 +36,13 @@ export async function load({ cookies, request, params, parent }) { await register(user, ip, cookies, `/fund/${id}/sweep`); } + let r; try { - await post("/take", { amount, id }, auth(cookies)); + r = await post("/take", { amount, id }, auth(cookies)); } catch (e) { redirect(307, `/fund/${id}`); } + + if (r) redirect(307, `/${user.username}`); return { amount, currency, id, rate, rates, password }; } -- cgit v1.2.3