Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create self-resource middleware
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 78f599a commit a40665b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions functions/api/me/_middleware.ts
@@ -0,0 +1,7 @@
import { jsonError } from "../../common.js";

export async function onRequest(context: RequestContext) {
if (!context.data.current_user) return jsonError("Not logged in", 401);

return await context.next();
}

0 comments on commit a40665b

Please sign in to comment.