From 97f9c4f245fb90df5c8048ac5a9e62208e37c484 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 15 Jan 2025 13:18:34 -0800 Subject: redirect --- src/routes/(app)/sign/+page.server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/routes/(app)/sign/+page.server.ts b/src/routes/(app)/sign/+page.server.ts index c10f183c..b0e319f0 100644 --- a/src/routes/(app)/sign/+page.server.ts +++ b/src/routes/(app)/sign/+page.server.ts @@ -1,6 +1,10 @@ import { auth, fd, post, types } from "$lib/utils"; +import { redirect } from "@sveltejs/kit"; + +export async function load({ cookies, parent, url }) { + const { user } = await parent(); + if (!user) redirect(307, `/register?redirect=${url.pathname}`); -export async function load({ cookies }) { const invoice = { address_type: "legacy", type: types.bitcoin, -- cgit v1.2.3