Created
April 7, 2021 20:24
-
-
Save mvxt/af595f0c274b73a3defb1372328e05b0 to your computer and use it in GitHub Desktop.
Custom Fields in Auth0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Other HTML above --> | |
<script src="https://cdn.auth0.com/js/lock/11.27/lock.min.js"></script> | |
<script> | |
var lock = new Auth0Lock(config.clientID, config.auth0Domain, { | |
auth: { | |
redirectUrl: config.callbackURL, | |
responseType: (config.internalOptions || {}).response_type || | |
(config.callbackOnLocationHash ? 'token' : 'code'), | |
params: config.internalOptions | |
}, | |
... (etc., other options), | |
// The part you care about here | |
additionalSignUpFields: [{ | |
name: "nickname", | |
storage: "root", | |
placeholder: "enter a unique username", | |
icon: "https://res.cloudinary.com/orpheus-studios/image/upload/c_scale,h_12/v1617793473/baseline_person_gray_24dp_iua7nk.png", | |
validator: function(nickname) { | |
return { | |
valid: nickname.length >= 4 && nickname.length <= 15, | |
hint: "Must be between 4 and 15 characters" | |
}; | |
} | |
}] | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment