REMOVE: addresses from populate callback function in findById function called on user model
This commit is contained in:
@@ -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, {}))
|
||||||
|
|||||||
Reference in New Issue
Block a user