import { redirect } from "@sveltejs/kit";
import type { LayoutServerLoad } from "./$types";

export const load: LayoutServerLoad = async ({ locals }) => {
	const sess = locals.session;
	if (!sess) {
		return redirect(302, "/auth/login");
	}
	return { session: sess, user: locals.user! };
};
