auth middleware

This commit is contained in:
2026-05-23 18:03:46 -05:00
parent 3bda27034a
commit 9e645fe06c
3 changed files with 24 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Request, Response, NextFunction } from "express";
import { users } from "../db/schema.ts";
export async function auth(
req: Request,
res: Response,
next: NextFunction
) {
// Either get the user profile of the logged in user,
// or default to anonymous permissions
const token = req.header("Authentication");
if (!token) {
return res.status(401).json({
error: "Missing Token",
});
};
next();
};