1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Password reset improvements.

This commit is contained in:
Ylian Saint-Hilaire 2020-12-09 22:14:51 -08:00
parent 005921cf7b
commit 650e0bf07c
8 changed files with 85 additions and 51 deletions

View file

@ -233,7 +233,7 @@ module.exports.CreateMeshMail = function (parent) {
};
// Send account reset mail
obj.sendAccountResetMail = function (domain, username, email, language, loginkey) {
obj.sendAccountResetMail = function (domain, username, userid, email, language, loginkey) {
obj.checkEmail(email, function (checked) {
if (checked) {
parent.debug('email', "Sending account password reset to " + email);
@ -252,7 +252,7 @@ module.exports.CreateMeshMail = function (parent) {
// Set all the options.
var options = { username: username, email: email, servername: domain.title ? domain.title : 'MeshCentral' };
if (loginkey != null) { options.urlargs1 = '?key=' + loginkey; options.urlargs2 = '&key=' + loginkey; } else { options.urlargs1 = ''; options.urlargs2 = ''; }
options.cookie = obj.parent.encodeCookie({ u: domain.id + '/' + username, e: email, a: 2 }, obj.mailCookieEncryptionKey);
options.cookie = obj.parent.encodeCookie({ u: userid, e: email, a: 2 }, obj.mailCookieEncryptionKey);
// Send the email
obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) });