diff --git a/src/routes/profile/create/+page.ts b/src/routes/profile/create/+page.ts new file mode 100644 index 0000000..69b13a9 --- /dev/null +++ b/src/routes/profile/create/+page.ts @@ -0,0 +1,10 @@ +import {redirect} from '@sveltejs/kit'; +import type {PageLoad} from './$types'; + +export const load: PageLoad = async ({parent, url}) => { + // the user has already done initial setup - go back to the normal profile + const parentData = await parent(); + if (parentData.user && parentData.user.name) { + throw redirect(302, '/profile'); + } +};