Skip to content

Instantly share code, notes, and snippets.

@nzpcmad
Last active June 20, 2018 03:45
Show Gist options
  • Save nzpcmad/58384013b67153098e0071f227f007bd to your computer and use it in GitHub Desktop.
Save nzpcmad/58384013b67153098e0071f227f007bd to your computer and use it in GitHub Desktop.
Auth0 playground
In the box at the top:
//cdn.auth0.com/js/lock/10.13.0/lock.min.js
Code follows:
var domain = 'xxx.auth0.com';
var clientID = '1gB0...wB7FjSa5P';
var options = {
allowSignUp: true,
allowForgotPassword: true,
additionalSignUpFields: [{
name: "address",
placeholder: "enter your address",
// The following properties are optional
icon: "https://example.com/assests/address_icon.png",
prefill: "street 123",
validator: function(address) {
return {
valid: address.length >= 10,
hint: "Must have 10 or more chars" // optional
};
}
},
{
name: "full_name",
placeholder: "Enter your full name"
},
{
type: "select",
name: "location",
placeholder: "choose your location",
options: [
{value: "us", label: "United States"},
{value: "fr", label: "France"},
{value: "ar", label: "Argentina"}
],
// The following properties are optional
icon: "https://example.com/assests/location_icon.png",
prefill: "us"
},
{
type: "checkbox",
name: "newsletter",
prefill: "true",
placeholder: "I hereby agree that I want to receive marketing emails from your company"
}
]
};
var lock = new Auth0Lock(clientID, domain, options);
lock.show();
@nzpcmad
Copy link
Author

nzpcmad commented Jun 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment