Merge pull request #22 from FreeCodeCamp/passreset

Passreset
pull/23/head
Free Code Camp 2015-01-12 22:10:35 -08:00
commit e46046c1f3
2 changed files with 9 additions and 8 deletions

View File

@ -428,7 +428,8 @@ exports.getReset = function(req, res) {
return res.redirect('/forgot');
}
res.render('account/reset', {
title: 'Password Reset'
title: 'Password Reset',
token: req.params.token
});
});
};
@ -581,18 +582,18 @@ exports.postForgot = function(req, res, next) {
from: 'Team@freecodecamp.com',
subject: 'Reset your Free Code Camp password',
text: [
'You are receiving this email because you (or someone else)',
'You are receiving this email because you (or someone else)\n',
'requested we reset your Free Code Camp account\'s password.\n\n',
'Please click on the following link, or paste this into your',
'Please click on the following link, or paste this into your\n',
'browser to complete the process:\n\n',
'http://',
req.headers.host,
'/reset/',
token,
'\n\n',
'If you did not request this, please ignore this email and',
'If you did not request this, please ignore this email and\n',
'your password will remain unchanged.\n'
].join(' ')
].join('')
};
transporter.sendMail(mailOptions, function(err) {
if (err) { return done(err); }

View File

@ -1,9 +1,9 @@
extends ../layout
block content
.col-sm-8.col-sm-offset-2
form(method='POST')
legend Reset Password
.col-sm-8.col-sm-offset-2.jumbotron
form(action='/reset/#{token}', method='POST')
h1 Reset Password
input(type='hidden', name='_csrf', value=_csrf)
.form-group
label(for='password') New Password