mirror of
https://github.com/sstent/expressmongotest.git
synced 2026-02-07 06:51:48 +00:00
refactored article to workout
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
function loggedIn(req, res, next) {
|
||||
if (! req.session.user) {
|
||||
//res.send('Forbidden. Please log in first.', 403);
|
||||
console.log("not logged in - redirecting to login");
|
||||
res.redirect('/session/new');
|
||||
} else {
|
||||
console.log("user logged in");
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user