I\'ve been looking for a while, and can\'t see to find a definitive documentation source. When I search for these, the first Google results are to StackOverflow.
Are
the reason it return false is mostly because its declared below the route definition. i am doing it in other file so i use it like this
//auth check function auth(req,res,next){ if(req.isAuthenticated()){ next(); } else{ res.redirect("/fail");} } //routes require("./routes/myroute")(app,auth);