akf-forum/middlewares/login.js
Akif9748 ae83e014a0 Mongoose is fixed & optimized
The dublicate key error fixed, ids as string.
classes removed. using mongoose's magic
2022-08-09 19:16:34 +03:00

4 lines
No EOL
115 B
JavaScript

module.exports = (req, res, next) => {
if (!req.session.userid) return res.redirect('/login');
next();
}