I faced this bug and by adding the passwordChangedAt at the end of this function I solved it hope you'll notice that.
exports.signup = catchAsync(async (req, res, next) => {
const newUser = await User.create({
name: req.body.name,
email: req.body.email,
password: req.body.password,
passwordConfirm: req.body.passwordConfirm,
passwordChangedAt: req.body.passwordChangedAt,
});
I faced this bug and by adding the passwordChangedAt at the end of this function I solved it hope you'll notice that.
exports.signup = catchAsync(async (req, res, next) => {
const newUser = await User.create({
name: req.body.name,
email: req.body.email,
password: req.body.password,
passwordConfirm: req.body.passwordConfirm,
passwordChangedAt: req.body.passwordChangedAt,
});