Password reset token issue


I ran into a pretty interesting issue recently with the password reset token and string interpolation. Any help would be appreciated.

I have the following code in a file like so:


if (Meteor.isServer) {
    Meteor.startup(function () {
        Accounts.urls.resetPassword = function(token) {
          return Meteor.absoluteUrl(`resetpassword?token=${token}`);

Now, the console.log(token) displays the correct reset token (the one written to the user’s profile). However, the URL sent has the letters 3D at the begining of every token sent. So for example, the following URL will be sent to the user:


but the token code is actually:


I’ve narrowed it down to the = sign. Once its added, the letters 3D are added to the URL.

Is this a bug or expected?



It looks like your reset URLs are being encoded somewhere along the line, since 3D is the hex code for the equals sign. If you make sure your MAIL_URL environment variable isn’t set, and fire a few test emails, what do you see when your email is dumped to standard out? If it looks okay when dumped out, then it could be your SMTP gateway (or receiving end mail client) that’s messing the URL up.


You are right, I just implemented my email verification and it does the same thing. I will chase it down and see who’s doing the encoding. Thanks for the reply.