This commit is contained in:
2026-03-19 16:07:35 +07:00
commit 39b0358b08
63 changed files with 3128 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import type { NextFunction, Request, Response } from "express";
import { UnauthorizedError } from "../utils/errors.js";
export function requireAuth(request: Request, _response: Response, next: NextFunction) {
if (!request.session.user) {
return next(new UnauthorizedError());
}
return next();
}