auth.js.tmpl 260 B

1234567
  1. module.exports = (req, res, next) => {
  2. if (req.header('${AUTH_REQ_HEADER_KEY}') != "${AUTH_REQ_HEADER_VALUE}" ) {
  3. res.header('X-Unauthorized', 'Allyship Is A Verb, Not A Noun');
  4. return res.status(401).send({ error: 'Unauthorized' });
  5. } else
  6. next();
  7. }