{"size": 737, "ext": "js", "max_stars_repo_path": "routes/backoffice/index.js", "max_stars_repo_name": "kermitt2/dataseer-web", "max_stars_repo_stars_event_min_datetime": "2019-11-04T02:46:51.000Z", "max_stars_repo_stars_event_max_datetime": "2020-07-23T23:28:18.000Z", "max_issues_repo_path": "routes/backoffice/index.js", "max_issues_repo_name": "kermitt2/dataseer-web", "max_issues_repo_issues_event_min_datetime": "2019-11-04T12:26:31.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-14T17:34:42.000Z", "max_forks_repo_path": "routes/backoffice/index.js", "max_forks_repo_name": "kermitt2/dataseer-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 72, "max_forks_count": null, "avg_line_length": 25.4137931034, "max_line_length": 97, "alphanum_fraction": 0.6824966079}
/*
 * @prettier
 */

'use strict';

const express = require(`express`);
const router = express.Router();

const passport = require(`passport`);

const AccountsManager = require(`../../lib/accounts.js`);
const Url = require(`../../lib/url.js`);

const conf = require(`../../conf/conf.json`);

router.get(`/upload`, function (req, res) {
  let accessRights = AccountsManager.getAccessRights(req.user, AccountsManager.match.all);
  if (!accessRights.authenticated)
    return res.redirect(Url.build(`/signin`, { unauthorized: true, redirect: req.originalUrl }));
  return res.render(`root/backoffice/upload/layout.pug`, {
    currentRoute: `/backoffice/upload`,
    currentUser: req.user,
    conf: conf
  });
});

module.exports = router;
