diff --git a/functions/api/appeals/_middleware.ts b/functions/api/appeals/_middleware.ts new file mode 100644 index 0000000..145e453 --- /dev/null +++ b/functions/api/appeals/_middleware.ts @@ -0,0 +1,12 @@ +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(); +}