I added additionalSignUpFields via Auth0-Lock for firstName, lastName and state to my Universal login.
const lock = new Auth0Lock(process.env.REACT_APP_AUTH0_CLIENT_ID, process.env.REACT_APP_AUTH0_DOMAIN, {
auth: {
redirectUrl: process.env.REACT_APP_AUTH0_CALLBACK_URL,
responseType: 'token',
},
closable: false,
initialScreen: 'signUp',
additionalSignUpFields: [
{
name: "firstName",
placeholder: "Enter your first name"
},
{
name: "lastName",
placeholder: "Enter your last name"
},
{
name: "state",
type: "select",
placeholder: "choose your region",
options: [
{value: "new_york", label: "New York"},
{value: "new_jersey", label: "New Jersey"},
{value: "washington", label: "Washington"},
{value: "ohio", label: "Ohio"},
{value: "iowa", label: "Iowa"},
],
prefill: "ohio",
}
]
});
My question is how do I access the custom fields? I tried accessing the “claims” and “user” objects but I do not see the custom fields
const { user, getIdTokenClaims } = useAuth0();
let claims = getIdTokenClaims();
console.log(user);
console.log(claims);
Here’s the output that I get…
Can someone point me in the right direction - how do I access the custom fields?