diff --git a/frontend/src/routes/(candidate)/(authenticated)/dashboard/+layout.server.ts b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+layout.server.ts new file mode 100644 index 0000000..400f787 --- /dev/null +++ b/frontend/src/routes/(candidate)/(authenticated)/dashboard/+layout.server.ts @@ -0,0 +1,11 @@ +import { apiFetchDetails } from '$lib/@api/candidate'; +import { redirect } from '@sveltejs/kit'; +import type { LayoutServerLoad } from './$types'; + +export const load: LayoutServerLoad = async ({ fetch }) => { + const details = await apiFetchDetails(fetch); + + if (details === null) { + throw redirect(302, '/register'); + } +};