Closed
Description
If i try to change the password for a user, i always got Object not found error after save user object.
This is my code i user in cloud code function.
`
var query = new Parse.Query(Parse.User);
query.equalTo("email", request.params.email);
return query.first().then(function(user) {
if (user && user.get('resetPasswordCode') === request.params.code) {
user.set('resetPasswordCode', '');
//if comment this line, work fine
user.setPassword(request.params.password);
return user.save();
} else {
return Parse.Promise.error(new FOLO.Error(FOLO.Error.RESET_PASSWORD_EMAIL_NOT_FOUND, "No account found with that email address."));
}
}).then(function() {
response.success(FOLO.Response());
}, function(error) {
response.error(error);
});
`