omnidash/apps/web/src/routes/(auth)/+layout.server.ts

10 lines
249 B
TypeScript

import { redirect } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';
export const load = (async ({ locals }) => {
if (locals.pb.authStore.isValid) {
throw redirect(303, '/');
}
return {};
}) satisfies LayoutServerLoad;