APP.GET('/', isLoggedIn, function(req, res) { if (isLoggedIn){res.render(index-authed) else { res.render(index)} });
how do i check what isLoggedIn returns? so i can handle flow like this?
You can pass loggedIn status in your req
object
in loggedIn function try adding following:
req.loggedIn = true;
and then in your next middleware function you can access req.loggedIn