diff --git a/functions/api/me/_middleware.ts b/functions/api/me/_middleware.ts new file mode 100644 index 0000000..e05b5bf --- /dev/null +++ b/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(); +}