Create GME framework
This commit is contained in:
parent
1e07afcc6e
commit
46255f6615
13
functions/api/gme/_middleware.ts
Normal file
13
functions/api/gme/_middleware.ts
Normal file
@ -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();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user