export async function onRequest(context: RequestContext) {
  if (!context.data.current_user)
    return new Response('{"error":"Not logged in"}', {
      headers: {
        "content-type": "application/json",
      },
      status: 401,
    });

  return await context.next();
}
