{"size": 412, "ext": "js", "max_stars_repo_path": "server/routers/route_middleware.js", "max_stars_repo_name": "InFact-coop/LCN", "max_stars_repo_stars_event_min_datetime": "2017-11-21T21:05:44.000Z", "max_stars_repo_stars_event_max_datetime": "2018-02-14T19:29:42.000Z", "max_issues_repo_path": "server/routers/route_middleware.js", "max_issues_repo_name": "InFact-coop/LCN", "max_issues_repo_issues_event_min_datetime": "2017-11-20T17:22:30.000Z", "max_issues_repo_issues_event_max_datetime": "2019-05-10T14:18:50.000Z", "max_forks_repo_path": "server/routers/route_middleware.js", "max_forks_repo_name": "InFact-coop/LCN", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 99, "max_forks_count": null, "avg_line_length": 22.8888888889, "max_line_length": 63, "alphanum_fraction": 0.6553398058}
const is_logged_in = (req, res, next) => {
  const onboardingURL = `/onboarding?token=${req.query.token}`;

  if (req.isAuthenticated()) return next();
  if (req.query.token) return res.redirect(onboardingURL);
  return res.redirect("/onboarding");
};

const is_admin = (req, res, next) => {
  if (req.user.admin === true) return next();
  res.redirect("/");
};

module.exports = {
  is_logged_in,
  is_admin
};
