akf-forum/middlewares/user.js

6 lines
162 B
JavaScript
Raw Normal View History

const { UserModel } = require("../models");
2022-04-06 21:14:46 +03:00
module.exports = async (req, res, next) => {
req.user = await UserModel.get(req.session.userid);
2022-04-06 21:14:46 +03:00
next();
}