Files
ember-market-frontend/backend/middleware/apiAuthMiddleware.js
2025-03-10 17:39:37 +00:00

11 lines
265 B
JavaScript

export const protectCrypto = async (req, res, next) => {
if (
req.headers.authorization &&
req.headers.authorization === process.env.INTERNAL_API_KEY
) {
return next();
}
return res.status(403).json({ error: "Forbidden: Invalid API key" });
};