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:
9
routes/middleware/not_logged_in.js
Normal file
9
routes/middleware/not_logged_in.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function notLoggedIn(req, res, next) {
|
||||
if (req.session.user) {
|
||||
res.redirect('/users/' + req.session.user.username);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = notLoggedIn;
|
||||
Reference in New Issue
Block a user