Forgot password token changed to hex instead of base64 to avoid having slashes in the url

This commit is contained in:
Sahat Yalkabov
2014-02-18 03:33:32 -05:00
parent d24045ec49
commit b7b74e70b3

View File

@ -36,8 +36,8 @@ exports.postForgot = function(req, res, next) {
async.waterfall([ async.waterfall([
function(done) { function(done) {
crypto.randomBytes(32, function(err, buf) { crypto.randomBytes(20, function(err, buf) {
var token = buf.toString('base64'); var token = buf.toString('hex');
done(err, token); done(err, token);
}); });
}, },