Spaces:
Sleeping
Sleeping
File size: 414 Bytes
7f81110 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | import { Request, Response, NextFunction } from "express";
import { env } from "../../../../../../config/env";
export function InternalSecretMiddleware(req: Request, res: Response, next: NextFunction): void {
const secret = req.headers["x-internal-secret"];
if (!secret || secret !== env.N8N_INTERNAL_SECRET) {
res.status(401).json({ error: "Unauthorized" });
return;
}
next();
} |