Passwordless with magic link

Please include the following information in your post:

  • Which SDK this is regarding: auth0.js
  • SDK Version: 9.15.0
  • Platform Version: Node 15.12.0

I have an SPA built in Gatsby with classic universal login (classic, because passwordless is not yet supported in the new universal login) and it seems that by default the passwordless login uses the code method. I’d like to change this to the magic-link method, but I can’t seem to find the right information about this.

I was going over the options object for the new auth0.WebAuth(options) but I can’t seem to find any options to change the passwordless method from code to magic-link.

In the auth0.js documentation, it says to set:
webAuth.passwordlessStart({
connection: ‘email’,
send: ‘code’,
email: ‘foo@bar.com’
}, function (err,res) {
// handle errors or continue
}
);

…but, if I understand correctly, this implies an embedded login form instead of using the auth0 hosted login.

So I’m confused: is it the case that auth0-hosted login doesn’t support magic-links and I should implement an embedded login or it does support magic-links and I’m missing some information on how to tell auth0 to use magic-links instead of codes?

Cheers!

Hi @andrecasal,

You won’t need to set up an embedded login. You can continue to use the hosted Universal Login by updating the lock passwordless options to use passwordlessMethod: 'link' in the template:

    var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
      // ...other configs
      passwordlessMethod: 'link',
    });

https://auth0.com/docs/libraries/lock

1 Like

Thanks @stephanie.chamblee that did the trick!

I’m having a few other problems I don’t quite understand (the email I’m receiving is not the one configured on my panel, silent authentication is not working with passwordless, etc). Should I post them here or create a new thread?

Glad that solved your question!

It’d be best to keep the details for each issue in its own topic so that people can easily find discussions if they run into the same thing. I will keep an eye out for your other topics!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.