21 lines
449 B
TypeScript
21 lines
449 B
TypeScript
export async function onRequest(context: RequestContext) {
|
|
const { current_user: currentUser } = context.data;
|
|
|
|
if (
|
|
!currentUser ||
|
|
![
|
|
"165594923586945025",
|
|
"289372404541554689",
|
|
"396347223736057866",
|
|
].includes(currentUser.id)
|
|
)
|
|
return new Response('{"error":"Forbidden"}', {
|
|
headers: {
|
|
"content-type": "application/json",
|
|
},
|
|
status: 403,
|
|
});
|
|
|
|
return await context.next();
|
|
}
|