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?
From what I can understand from your question, in order to check what isLoggedIn returns, you can do that by a simple console.log like this:
console.log(isLoggedIn);
If you're using connect/express, it should return a Boolean.
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