code: function mustBeLoggedIn(req, res, next) {
    if (req.session && req.session.user) {
      next();
    }
    else {
      res.status(401).send('You must be logged-in to access this resource');
    }
  }
docs: Prevents access to anonymous users.