12 lines
279 B
TypeScript
12 lines
279 B
TypeScript
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();
|
|
}
|