Search code examples
node.jsmongodbparse-platformparse-server

Parse server custom change password not working


I have written a function to change the password of a user in Parse Server. which gives a success on changing in return but does not update the password in MongoDB.Not just the password ever profile data is not updated. Can anybody suggest what am I doing wrong?

function changePassword(req, res) {
    const _params      = req.params;
    const _user        = req.user;
    const _password    = _params.password;
    _user.setPassword(_password);
    _user.save();
    res.success("password updated");
}

Solution

  • _user.save(null, {useMasterKey:true});