diff --git a/lib/models/user.js b/lib/models/user.js index 652051ea..639d383d 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -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);