mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 23:45:02 +00:00
8 lines
311 B
TypeScript
8 lines
311 B
TypeScript
import { Request, Response, NextFunction } from "express";
|
|
|
|
export function checkAuthorized(req: Request, res: Response, next: NextFunction) {
|
|
if(import.meta.env.VITE_AUTH_ENABLED === "False" || req.user) {
|
|
return next();
|
|
}
|
|
return res.status(403).json({"Error": "Authentication failed."});
|
|
} |