mirror of
https://github.com/sstent/expressmongotest.git
synced 2026-02-02 12:32:15 +00:00
almost rebased
This commit is contained in:
9
test/routes/middleware/not_logged_in.js
Normal file
9
test/routes/middleware/not_logged_in.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function notLoggedIn(req, res, next) {
|
||||
if (req.session.user) {
|
||||
res.send('Unauthorized', 401);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = notLoggedIn;
|
||||
Reference in New Issue
Block a user