Files
expressmongotest/test/routes/middleware/not_logged_in.js
2013-01-14 18:22:57 -05:00

9 lines
159 B
JavaScript

function notLoggedIn(req, res, next) {
if (req.session.user) {
res.send('Unauthorized', 401);
} else {
next();
}
}
module.exports = notLoggedIn;