10 lines
383 B
TypeScript
10 lines
383 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import { createConvexAuthHandlers } from '@mmailaender/convex-auth-svelte/sveltekit/server';
|
|
import type { PageServerLoad } from './$types.js';
|
|
|
|
const { isAuthenticated } = createConvexAuthHandlers();
|
|
|
|
export const load: PageServerLoad = async (event) => {
|
|
throw redirect(302, (await isAuthenticated(event)) ? '/dashboard' : '/signin');
|
|
};
|