mirror of
https://github.com/bodyrep/DemoApp.git
synced 2026-01-25 22:51:37 +00:00
migrating repo to Bodyrep org
This commit is contained in:
11
routes/middleware/logged_in.js
Normal file
11
routes/middleware/logged_in.js
Normal file
@@ -0,0 +1,11 @@
|
||||
function loggedIn(req, res, next) {
|
||||
if (! req.session.user) {
|
||||
console.log("not logged in - redirecting to login");
|
||||
res.redirect('/session/new');
|
||||
} else {
|
||||
console.log("user logged in");
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = loggedIn;
|
||||
Reference in New Issue
Block a user