forked from UKSOURCE/cms.hailearning.edu.vn
first commit
This commit is contained in:
9
middleware/auth.js
Normal file
9
middleware/auth.js
Normal file
@@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
ensureAuthenticated: function(req, res, next) {
|
||||
if (req.session.isAuthenticated) {
|
||||
return next();
|
||||
}
|
||||
req.flash('error_msg', 'Please login to access this page');
|
||||
res.redirect('/auth/login');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user