Files
AnimeTV-Backend/src/middleware/auth.middleware.ts
2025-05-13 14:35:48 +07:00

11 lines
215 B
TypeScript

import { Context } from "elysia";
export const authMiddleware = (ctx: Context) => {
const token = ctx.cookie.auth_token;
if (!token) {
ctx.set.status = 401;
throw "Unauthorized: Token missing";
}
};