简体   繁体   中英

is allowSignUp option available in auth0-js 8.x.x?

I am using the new auth0 hosted login page in place of the deprecated widget. With the lock widget you were able to pass in an allowSignUp boolean in the option object like so:

var options = {
  allowSignUp: false
};

var lock = new Auth0Lock('clientID', 'account.auth0.com', options);

Has anyone figured out how to disable the sign up option using this new auth flow?

In order to pass this option from the client to the auth0 lock widget you need edit your hosted login page logic.

To pass this option we supply the object to the webAuth authorize method like this:

webAuth.authorize({allow_sign_up: false})

This will encode it into the URL which can then be detected and passed into the auth0 lock widget from the hosted login page.

You can read the query string section of the hosted login page for technical details.

The gist is that it can be accessed like this:

var allowSignUp = config.extraParams.allow_sign_up !== 'false'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM