akf-forum/middlewares/user.js

6 lines
No EOL
163 B
JavaScript

const { User } = require("../classes");
module.exports = async (req, res, next) => {
req.user = await new User().getById(req.session.userid);
next();
}