🚨 fix: resolve linting type error

This commit is contained in:
2026-01-31 08:13:04 +07:00
parent 5a43769f69
commit 68fec64efc
11 changed files with 21 additions and 35 deletions

View File

@ -1,5 +1,12 @@
import { Context } from "elysia";
export const isAdminMiddleware = (ctx: Context) => {
//validate here
const isAdmin = ctx.headers["isAdmin"];
if (!isAdmin) {
ctx.set.status = 403;
return {
error: "Forbidden",
message: "You don't have access to this resource",
};
}
};