diff --git a/api/src/middleware/admin-auth.ts b/api/src/middleware/admin-auth.ts index c14fe22..643e97c 100644 --- a/api/src/middleware/admin-auth.ts +++ b/api/src/middleware/admin-auth.ts @@ -39,3 +39,26 @@ export function requireAdmin(req: Request, res: Response, next: NextFunction): v res.status(401).json({ error: "Invalid or expired token." }); } } + +/** + * Verify admin JWT from EITHER the Authorization header OR a `?token=` query + * param. Needed for endpoints opened directly by the browser (e.g. a PDF in a + * new tab /