Auth0 Home Blog Docs

Additional fields in sign-in form


#1

Is it possible to add an extra input field to lock. Along with username password, I need an extra field to identify client.


#2

Our docs and searching are a good starting point:


#3

Yes I looked at docs though I could not find any info for field addition in sign in form. It would be great if you could point to some of the resources.


#4

The Lock documentation which is linked in the document referenced above, includes instructions on how to add additional fields https://auth0.com/docs/libraries/lock/v11/configuration#additionalsignupfields-array-

e.g.

var options = {
  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"
 }]

}