feat: resetPasswordRequest use more params
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2022-11-23 14:43:18 +01:00
parent 30a25664de
commit 7651dcb473
2 changed files with 6 additions and 2 deletions

View File

@ -19,7 +19,7 @@ module.exports = Self => {
const models = Self.app.models;
try {
await models.user.resetPassword({email});
await models.user.resetPassword({email, emailTemplate: 'recover-password'});
} catch (err) {
if (err.code === 'EMAIL_NOT_FOUND')
return;

View File

@ -16,7 +16,11 @@ module.exports = function(Self) {
url: `${origin}/#!/reset-password?access_token=${info.accessToken.id}`
};
const email = new Email('recover-password', params);
const options = Object.assign({}, info.options);
for (const param in options)
params[param] = options[param];
const email = new Email(options.emailTemplate, params);
return email.send();
});