using base64 caused an occasional token string to contain '+' which resulted in a space being embedded in the token. 'hex' should always produce a url safe string for the token.

This commit is contained in:
Doug Toppin 2014-02-25 22:14:32 -05:00
parent 2f301e315a
commit 42c9777de3
1 changed files with 2 additions and 1 deletions

View File

@ -281,7 +281,8 @@ User.prototype.verify = function (options, fn) {
if(err) { if(err) {
fn(err); fn(err);
} else { } else {
user.verificationToken = buf.toString('base64'); // base64 may not produce a url safe string so we are using hex
user.verificationToken = buf.toString('hex');
user.save(function (err) { user.save(function (err) {
if(err) { if(err) {
fn(err); fn(err);