Passwordless send email auth0 SDK returns 'Connection does not exist 'l

Me and my team have already integrated auth0 passwordless universal login in our React app, and decided that we need more customized login UI. I have read some posts that we either need to use the auth.js or the authentication API, but we don’t want to change the whole logic of the app just to customize the login and use the auth0-react SDK, but it came out to be impossible. So we decided to use the custom login form template and to customize it using the auth0.js and again make it passwordless. While trying to send the email we got the following error:

{"error":"bad.connection","error_description":"Connection does not exist"}

We got the following configuration:

<script src="https://cdn.auth0.com/js/auth0/9.19.0/auth0.min.js"></script>

var config = JSON.parse(
  decodeURIComponent(escape(window.atob('@@config@@')))
);
var params = Object.assign({
    overrides: {
     __tenant: config.auth0Tenant,
     __token_issuer: config.authorizationServer.issuer
    },
    domain: config.auth0Domain,
    clientID: config.clientID,
    redirectUri: config.callbackURL,
    responseType: token id_token'
 }, config.internalOptions);
        
var webAuth = new auth0.WebAuth(params);

function login(e) {
   e.preventDefault();
   clearErrors();
   var button = this;
   var email = document.getElementById('loginemail').value;
   button.disabled = true;
   webAuth.passwordlessStart({
       connection: 'email',
       send: 'code'
       email: email,
   }, function(err) {
          if (err) displayError(err);
          button.disabled = false;
      });
  }

So, my question is if what we are trying to do is even possible, considering that we are using the custom login template. If not can you suggest us other alternatives for implementing custom UI with auth0-react SDK?

Hi @n.mihaylovv

Welcome to the Auth0 Community!

You should be able to get to this setup to work as per our documentation here https://auth0.com/docs/authenticate/login/auth0-universal-login/passwordless-login/email-or-sms#universal-login-custom-ui-auth0-js

Your code snippet looks correct from what I can tell, referring to our docs here https://auth0.com/docs/libraries/auth0js#start-passwordless-authentication

I can only think there may have been an oversight on the connections tab for the relevant application/client in Auth0, can you navigate to the application and check the connections tab to ensure the application has the email connection toggle switched on under Passwordless?

Many thanks

2 Likes