Passing initialScreen to Lock from WebAuth

According to the documentation you can pass custom parameters.

Have in mind that the parameters are sent by the client application so the end-user can modify them and as such, in general, you should not make any security decision based on them. For your specific scenario the parameter is used just to influence the default UI shown so the above does not apply as it has no security implications.


From the webAuth.authorize depending on the user intentions you would pass a conditional parameter:

webAuth.authorize({ mode: "[login|signUp]", /* other options*/ });

On the hosted login page you would configure Lock with:

var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
    initialScreen: config.extraParams.mode,
    /* other options */
});
3 Likes