Auth0 Home Blog Docs

Prefill sign-in email field with lock widget



I’m using lock v10.20.0 and whenever I set a prefill value for the email it is only filled out in the sign-up form. I also need it to be set at the sign-in form.

I set the options like described in the docs:

options = {
  prefill: {
    email: ""

I also checked with lock v11.2.2. There the prefill is as well only set in the signup modal.
Is there a way to also prefill the login email field?


Using v11.1.2, we have been able to get this “prefill” option to work for our sign-in form using the embedded Lock. Our use case is to have the email prefilled for subsequent authentications once they have initially authenticated using it.

if (defaultUserName) {
options.prefill = {
email: Authentication.GetCurrentUserName(),
username: “”

    Cloud.AuthenticationContext = new Auth0Lock(appClientID, domainName, options);


The prefill option of Lock will set the value for both the signin and signup fields. This simple example should do the trick:

<!doctype html>
  <script src=""></script>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
	window.addEventListener('load', function() {
      var AUTH0_DOMAIN = "{{YOUR_AUTH0_DOMAIN}}";

      var options = {
        oidcConformant: true,
        prefill: {
          email: ""
	  var lock = new Auth0Lock(AUTH0_CLIENT_ID, AUTH0_DOMAIN, options);
      document.getElementById('login_button').addEventListener('click', function() {;

      lock.on("authenticated", function(authResult) {
  <button id="login_button">Log In</button>

If this simple script does not show you the email prefilled in both the signin and signup fields, you can check your console log for any errors. Another option is to try it in other browsers to see if the behaviour remains.


We needed to set the username as well as the email in the lock option prefill:

options = {
   prefill: {
     email: "",
     username: ""

Now the email is set in the signin and signup form.