Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create GME framework
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 1e07afc commit 46255f6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions functions/api/gme/_middleware.ts
@@ -0,0 +1,13 @@
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();
}

0 comments on commit 46255f6

Please sign in to comment.