diff options
| author | Adam Soltys <[email protected]> | 2026-02-16 08:45:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-16 08:45:37 -0800 |
| commit | fe104c2364de35bcdb2a10ca469cd25c12b04289 (patch) | |
| tree | ac781e1ba58afd43ba93b91c6965797ff8de3eee /src/routes/(app)/account/ark | |
| parent | 8905ad48f91e24cbb2427256a88128462a51a7a0 (diff) | |
| download | coinos-ui-fe104c2364de35bcdb2a10ca469cd25c12b04289.tar.gz coinos-ui-fe104c2364de35bcdb2a10ca469cd25c12b04289.zip | |
Prevent duplicate Ark vault accounts
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Diffstat (limited to 'src/routes/(app)/account/ark')
| -rw-r--r-- | src/routes/(app)/account/ark/+page.server.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/routes/(app)/account/ark/+page.server.ts b/src/routes/(app)/account/ark/+page.server.ts new file mode 100644 index 00000000..90e617ff --- /dev/null +++ b/src/routes/(app)/account/ark/+page.server.ts @@ -0,0 +1,10 @@ +import { auth, get } from "$lib/utils"; +import { redirect } from "@sveltejs/kit"; + +export async function load({ cookies, parent }) { + const { user } = await parent(); + const accounts = await get("/accounts", auth(cookies)); + if (accounts.some((a) => a.type === "ark")) { + redirect(307, `/${user.username}`); + } +} |
