|
|
|
@ -54,10 +54,13 @@ exports.reset = async ctx => { |
|
|
|
} |
|
|
|
try { |
|
|
|
const user = await getGlobalUserByEmail(email) |
|
|
|
await sendEmail(email, EmailTemplatePurpose.PASSWORD_RECOVERY, { |
|
|
|
user, |
|
|
|
subject: "{{ company }} platform password reset", |
|
|
|
}) |
|
|
|
// only if user exists, don't error though if they don't
|
|
|
|
if (user) { |
|
|
|
await sendEmail(email, EmailTemplatePurpose.PASSWORD_RECOVERY, { |
|
|
|
user, |
|
|
|
subject: "{{ company }} platform password reset", |
|
|
|
}) |
|
|
|
} |
|
|
|
} catch (err) { |
|
|
|
// don't throw any kind of error to the user, this might give away something
|
|
|
|
} |
|
|
|
|