Skip to content

User setPassword cause Object not found #260

Closed
@flessard

Description

@flessard

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);
});

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions