Create self-resource middleware
This commit is contained in:
parent
78f599ac2c
commit
a40665bd6c
7
functions/api/me/_middleware.ts
Normal file
7
functions/api/me/_middleware.ts
Normal file
@ -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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user