first commit

This commit is contained in:
r2xrzh9q2z-lab
2026-02-02 11:07:09 +07:00
commit d1b931d547
286 changed files with 53992 additions and 0 deletions

9
middleware/auth.js Normal file
View 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');
}
};