Is there an optional authentication middleware from Passport.js?
Let\'s say I have a route, /api/users. I want to give just a list of users to the publi
Might be late now, but there's an anonymous Passport strategy to allow exactly this. That way the public routes can either take authentication or not, but when they do you'll still have all of the information associated with the authenticated user. Check it out here: https://github.com/jaredhanson/passport-anonymous