akf-forum/middlewares/user.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

6 lines
No EOL
162 B
JavaScript

const { UserModel } = require("../models");
module.exports = async (req, res, next) => {
req.user = await UserModel.get(req.session.userid);
next();
}