old_contents: export default function authRequired(req, res, next) {
    if (req.user.isAdmin) {
      next();
    } else {
      res.status(403);
      res.json({
        id: 'AUTH_FORBIDDEN',
        message: 'You need admin privilege to run this command.'
      });
    }
  }
  
new_contents: export default function adminRequired(req, res, next) {
    if (req.user && req.user.isAdmin) {
      next();
    } else {
      res.status(403);
      res.json({
        id: 'AUTH_FORBIDDEN',
        message: 'You need admin privilege to run this command.'
      });
    }
  }
  
subject: Fix admin checking throwing error if not logged in