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:
/server/password_reset.js
if (Meteor.isServer) {
Meteor.startup(function () {
Accounts.urls.resetPassword = function(token) {
console.log(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:
/resetpassword?token=3D3zdIJqH8az_Ux3KghfYla1tmkSq4NHTDA2DNGofjZPE
but the token code is actually:
3zdIJqH8az_Ux3KghfYla1tmkSq4NHTDA2DNGofjZPE
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?
Thanks.