2023-10-19 16:49:40 -04:00

14 lines
345 B
TypeScript

export async function onRequest(context: RequestContext) {
const { current_user: currentUser } = context.data;
if (!currentUser || !(currentUser & (1 << 5)))
return new Response('{"error":"Forbidden"}', {
headers: {
"content-type": "application/json",
},
status: 403,
});
return await context.next();
}