Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create login check middleware for all appeals api routes
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 732e9f0 commit cce71c9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 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();
}

0 comments on commit cce71c9

Please sign in to comment.