Choose Either Link or Code Response on Passwordless Emails

Problem statement

Using Classic Universal Login, is it possible to have the user select if they want to use code or link on passwordless emails rather than be forced to use one or the other?


This functionality does not appear to be available out of the box, however it is possible to pass a variable into the Classic Universal Login template and use that for example:

var passwordlessMethod = config.extraParams.passwordless_method;

    var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
      auth: {
        redirectUrl: config.callbackURL,
        responseType: (config.internalOptions || {}).response_type ||
          (config.callbackOnLocationHash ? 'token' : 'code'),
        params: config.internalOptions
      language: language,
      passwordlessMethod: passwordlessMethod,
      languageBaseUrl: config.languageBaseUrl,

Send passwordless_method (or any parameter name) via the /authorize redirection like this:


The relevant Auth0 SDK will have a way of passing login parameters. Refer to the SDK documentation.