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
Raw Normal View History

2021-11-25 01:25:27 +00:00
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
2021-11-25 01:25:27 +00:00
});
2021-11-25 01:25:27 +00:00
module.exports = router;