Problem with the Meteor.passwordlessLoginWithToken and its selector only accepts email (accounts-passwordless)

Hey guys.

So while trying out the accounts-passwordless package, I am on the stage where I got the code or login token on my email and then I will enter it on my verify login token page then suddenly the is any error saying “Token mismatch” but upon checking its the same as what sent in my email.

For the context:

  1. I customized the email template
  2. I did not use the redirect link to login right away (because our requirements say so)
  3. I am using the username (as per our requirements) not the email as a selector
  4. It’s working if I use email as a selector not the username but the documentation says The selector accepts Username, email and a custom selector . but as you know, our requirements in this login workflow is the username not the email.
  5. Upon checking the “services.passwordless” field on the user doc, it is paired with the email, so I assume that is why its not working if I use username as a selector

Follow up:

  • With this, I am pretty keen to understand what am I doing wrong, and what am I missing.
  • With assumptions, How can I bypass this to pair the token with the username?

Any help will do.

Thanks!

  • Steven

Take a look how we use it here GitHub - quavedev/accounts-passwordless-react

If you have follow up questions let me know

Btw, be sure you are generating only one token.