mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-17 17:32:22 +00:00
use email server for reset-password
This commit is contained in:
parent
e79126bf59
commit
1761752240
1 changed files with 9 additions and 9 deletions
|
|
@ -206,16 +206,16 @@ api.resetPassword = function(req, res, next){
|
|||
if (!user) return res.send(500, {err:"Couldn't find a user registered for email " + email});
|
||||
user.auth.local.salt = salt;
|
||||
user.auth.local.hashed_password = hashed_password;
|
||||
utils.sendEmail({
|
||||
from: "HabitRPG <admin@habitrpg.com>",
|
||||
to: email,
|
||||
subject: "Password Reset for HabitRPG",
|
||||
text: "Password for " + user.auth.local.username + " has been reset to " + newPassword + ". Log in at " + nconf.get('BASE_URL'),
|
||||
html: "Password for <strong>" + user.auth.local.username + "</strong> has been reset to <strong>" + newPassword + "</strong>. Log in at " + nconf.get('BASE_URL')
|
||||
utils.txnEmail(user, 'reset-password', {
|
||||
NEW_PASSWORD: newPassword,
|
||||
URL: nconf.get('BASE_URL'),
|
||||
USERNAME: user.auth.local.username
|
||||
});
|
||||
user.save(function(err){
|
||||
if(err) return next(err);
|
||||
res.send('New password sent to '+ email);
|
||||
email = salt = newPassword = hashed_password = null;
|
||||
});
|
||||
user.save();
|
||||
res.send('New password sent to '+ email);
|
||||
email = salt = newPassword = hashed_password = null;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue