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:
parent
2f301e315a
commit
42c9777de3
|
@ -281,7 +281,8 @@ User.prototype.verify = function (options, fn) {
|
|||
if(err) {
|
||||
fn(err);
|
||||
} 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) {
|
||||
if(err) {
|
||||
fn(err);
|
||||
|
|
Loading…
Reference in New Issue