server/lib/routes.js
// route middleware to make sure a user is logged in
route middleware to make sure a user is logged in
route middleware to make sure a user is logged in
function isLoggedIn(req, res, next) {
  if (req.isAuthenticated())
    return next();
  res.send(401);
}
function isLoggedIn ( req , res , next ) { if ( req . isAuthenticated ( ) ) return next ( ) ; res . send ( 401 ) ; }
route middleware to make sure a user is logged in
route middleware to make sure a user is logged in
// if user is authenticated in the session, carry on  // if they aren't redirect them to the home page