REMOVE: addresses from populate callback function in findById function called on user model

This commit is contained in:
MohammadHMazarei
2024-12-24 20:07:28 +03:30
parent 8fae7769fd
commit 85a2dc7e7a
+1 -1
View File
@@ -28,7 +28,7 @@ exports.loginProtect = async (req, res, next) => {
} }
// 3) check if user still exist // 3) check if user still exist
const loggedInUser = await User.findById(decodedToken.id).populate('role addresses') const loggedInUser = await User.findById(decodedToken.id).populate('role')
if (!loggedInUser) { if (!loggedInUser) {
return next(new AppError('TokenUserNotExist', 401, {})) return next(new AppError('TokenUserNotExist', 401, {}))