Skip to content

Instantly share code, notes, and snippets.

@grownseed
Last active December 11, 2015 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save grownseed/4667764 to your computer and use it in GitHub Desktop.
Save grownseed/4667764 to your computer and use it in GitHub Desktop.
//in main app.js
var auth = require('./lib/auth');
//...
app.use(auth.checkPermissions());
//in lib/auth.js
exports.checkPermissions = function() {
return function checkPermissions(err, req, res, next) {
//sometimes this simply never kicks in,
//when it does req.route is not defined
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment