title: Use Authentication function in express route
body: <p>I have my controller like this </p>
  
  <pre><code>//Get the Helpers
  var authHelper = require('authHelper');
  
  //Route
  router.get('/manager', authHelper.checkPerm(req, res, next), function(req, res) {
  
  });
  </code></pre>
  
  <p><strong>my authHelper.js</strong></p>
  
  <pre><code>exports.checkPerm = function(req, res, next){
    if (req.user) {
      next();
    } else {
      res.redirect('/sign-in');
    }
  }
  </code></pre>
  
  <p>This is the error i am getting </p>
  
  <blockquote>
    <p>router.get('/manager', authHelper.checkPerm(req, res, next),
    function(req, res
                                                ^ ReferenceError: req is not defined</p>
  </blockquote>