UNPKG

@greenpress/secrets

Version:
10 lines (8 loc) 242 B
const { internalSecret } = require('../../config') module.exports = (req, res, next) => { if (req.headers.internal_secret === internalSecret) { next() } else { res.status(401).json({ message: 'you are not allowed' }).end() } }