import { redirect } from "@sveltejs/kit";

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