When does requestPasswordReset throw error?

I have the following code:

return parse.User.requestPasswordReset(email).then(() => Promise.resolve()).catch((err) => Promise.reject(err));

for me the code never throws any error and always resolves. When will the requestPasswordReset throw errors? I thought it would happen if the provided email isn’t matched with a previously registered email address, but I can’t seem to trigger any form of error.
I noticed the secondary parameter called options is called something like “successFailureOptions” from the typescript definition. Does this affect how errors are triggered?

Grateful for any help!

This endpoint currently returns no errors to avoid e-mail enumeration as you can see here: parse-server/UsersRouter.js at master · parse-community/parse-server · GitHub

There are discussions in place to change this behavior though.

2 Likes