Add two distinct password reset routes
This commit is contained in:
+4
-2
@@ -152,8 +152,10 @@ async function sendNewLoginLocation(user, loginLocation) {
|
||||
await sendMail(mailOptions);
|
||||
}
|
||||
|
||||
async function passwordReset(user, resetLink) {
|
||||
async function passwordReset(user, email, resetLink) {
|
||||
assert.strictEqual(typeof user, 'object');
|
||||
assert.strictEqual(typeof email, 'string');
|
||||
assert.strictEqual(typeof resetLink, 'string');
|
||||
|
||||
const mailConfig = await getMailConfig();
|
||||
const translationAssets = await translation.getTranslations();
|
||||
@@ -167,7 +169,7 @@ async function passwordReset(user, resetLink) {
|
||||
|
||||
const mailOptions = {
|
||||
from: mailConfig.notificationFrom,
|
||||
to: user.fallbackEmail,
|
||||
to: email,
|
||||
subject: ejs.render(translation.translate('{{ passwordResetEmail.subject }}', translationAssets.translations || {}, translationAssets.fallback || {}), { cloudron: mailConfig.cloudronName }),
|
||||
text: render('password_reset-text.ejs', templateData, translationAssets),
|
||||
html: render('password_reset-html.ejs', templateData, translationAssets)
|
||||
|
||||
Reference in New Issue
Block a user