This repository has been archived on 2024-04-05. You can view files and clone it, but cannot push or open issues/pull-requests.
score-tracker/routes/admin.js

24 lines
528 B
JavaScript

var express = require('express');
var router = express.Router();
const passport = require('passport');
const app = require('../app');
const accounts = require('./../database/accounts/accounts');
function adminLoggedIn(req, res, next) {
if (req.user && req.user[2]) {
next();
}
else {
req.flash('error', 'An admin account is required to access this page.');
res.redirect('/auth/login');
}
}
router.get('/', adminLoggedIn, (req, res, next) => {
res.render
});
module.exports = router;