import { redirect } from "@sveltejs/kit";
import { isModel } from "$lib/api";

export async function load({ locals }) {
  if (!locals.authStatus.authenticated) {
    throw redirect(302, "/login");
  }
  return {
    authStatus: locals.authStatus,
    isModel: isModel(locals.authStatus.user!),
  };
}
