diff --git a/frontend/src/routes/(candidate)/auth/login/+layout.server.ts b/frontend/src/routes/(candidate)/auth/login/+layout.server.ts new file mode 100644 index 0000000..9198de9 --- /dev/null +++ b/frontend/src/routes/(candidate)/auth/login/+layout.server.ts @@ -0,0 +1,11 @@ +import type { LayoutServerLoad } from './$types'; + +import { redirect } from '@sveltejs/kit'; + +export const load: LayoutServerLoad = ({ cookies }) => { + const isAuthenticated = cookies.get('id'); + + if (isAuthenticated) { + throw redirect(302, '/dashboard'); + } +};