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.'
    });
  }
}

@@ -22,11 +22,12 @@
 on a
-uth
+dmin
 Requ
@@ -63,16 +63,28 @@
 req.user
+ && req.user
 .isAdmin

Fix admin checking throwing error if not logged in