reorganization of source code

This commit is contained in:
azivner
2017-10-15 19:47:05 -04:00
parent 38b95a743b
commit 0c823a2927
315 changed files with 99 additions and 530 deletions

20
services/auth.js Normal file
View File

@@ -0,0 +1,20 @@
function checkAuth(req, res, next) {
if (!req.session.loggedIn) {
res.redirect("login");
} else {
next();
}
}
function checkApiAuth(req, res, next) {
if (!req.session.loggedIn) {
res.sendStatus(401);
} else {
next();
}
}
module.exports = {
checkAuth,
checkApiAuth
};