function basicAuth(req, res, next) {
  const auth = req.get('authorization');
  if (!auth) return next();

  const parts = auth.split(' ');