Express resources with authentication middleware?
问题 Passport.js offers great authentication for node.js and Express including a middleware solution: ensureAuthenticated = function(req, res, next) { if (req.isAuthenticated()) { return next(); } return res.redirect("/login"); }; How can I use this middleware in the express-resource module? Unfortunately, app.resource('users', ensureAuthenticated, require('./resources/users')); doesn't work. 回答1: I know this is a little too late, and the original post was answered, however, I was looking for the