You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
326B

  1. import config from "../config";
  2. function lock(req, res, next) {
  3. if (req.body.token !== config.token)
  4. res.json({
  5. success: false,
  6. error: {
  7. code: "AUTHENTICATION_NEEDED",
  8. msg: "you're not authenticated, add a token to your request body",
  9. },
  10. });
  11. else next();
  12. }
  13. export default lock;