Return success on sendPasswordResetEmail even if email not found.

This commit is contained in:
Arthur Cinader
2018-10-05 09:28:53 -07:00
parent 7a01fa0a67
commit 7fe4030453

View File

@@ -357,10 +357,11 @@ export class UsersRouter extends ClassesRouter {
},
err => {
if (err.code === Parse.Error.OBJECT_NOT_FOUND) {
throw new Parse.Error(
Parse.Error.EMAIL_NOT_FOUND,
`No user found with email ${email}.`
);
// Return success so that this endpoint can't
// be used to enumerate valid emails
return Promise.resolve({
response: {},
})
} else {
throw err;
}