Fill the Forgot Password e-mail input with the same value as the e-mail input on the Login page

Hello everyone!

Is there any way to fill the e-mail input on the Forgot Password page with the same value as the e-mail input on the Login page? The “prefill" Auth0Lock property does not work for me because I need to dynamically fill this input when the user switch tabs. I have been trying to do it with Javascript, but everytime I click on the input in the Forgot Password page the input value is set to empty again.

Thanks in advance,
Luiz Faleiro.

Hi @luiz.faleiro.nutrien,

Welcome to the Auth0 Community!

By default, the Auth0 Login and Forget Password pages dynamically fill the email address text field with the text the user had typed. Regardless of the user switching between these pages, the filled-in email text field will remain the same.

Because of this, could you clarify how you are getting this behavior?

And, are you using the Universal Login page? If not, what SDK are you using?

1 Like

Hello @rueben.tiow, thanks for your answer!

By default the e-mail address is not being added to the Forgot Password page. I am using the Universal Login page and tried to add this behavior inside the Auth0Lock “forgot_password ready” event by getting the e-mail input value and adding to the same input on the Forgot Password page. Here’s what I did:

var username = document.querySelector('[name="username"]').value;
document.querySelector('[name="email"]').value = username;

Is there a setting that should be on the code or on the Auth0 environment for this behavior to work properly? I never worked with this platform before so there may be something that I am missing. If you need any other info please let me know!

EDIT: Even though the code above set the value to the Forgot Password e-mail input, I get an error message stating that the e-mail input should not be empty. Also, if I set the focus to the input the value is set to empty. Here’s an example:

3df4d531-f88b-4295-ac8d-f22481665dc9

@rueben.tiow I got in depth in the Universal Login page and figured out something interesting: the behavior to add the e-mail from the Login page to the Forgot Password page works perfectly if there’s no Connection Resolver on the code. As soon as I add the Connection Resolver it stops working, doesn’t matter what is the content inside the resolver.

Do you have any idea how to workaround it?

Hi @luiz.faleiro.nutrien,

Thank you for your responses.

I have tried replicating the behavior you described and was not able to get the same results.

Each time I was able to populate the email address in the login, signup, and forgot password pages. I was also able to press the Send Email button on the forgot password page without errors.

Because of this, could you please DM me a copy of your Universal Login Page to try to replicate the issue on my end?

AFAIK, your desired behavior should be working for all conditions by default, regardless of the connectionResolver option.

Thanks!

1 Like

Hi @rueben.tiow,

I’m currently talking to my teammates to provide you the Universal Login Page as you requested. Meanwhile, it’s important to note, if relevant, that we are using the version 11.30.0 of the Auth0Lock.

I also opened this issue regarding this problem with some examples. Feel free to ask any other questions if needed.

Thank you for your help so far!

1 Like

Just sent you a DM, @rueben.tiow!

Hi @luiz.faleiro.nutrien,

Thank you.

After my investigation, I found an interesting behavior. Originally, when I was testing, I did not encounter problems with my ULP page when I included the connectionResolver. It was an oversight on my side.

Because now, I can confirm that the connectionResolver property is influencing the behavior of the ULP page and treating the email address as a username instead of an email address.

If you try filling out an email address first in the Forgot Password Page, then navigate to the Sign Up page, you will see that it populates the username property and not the email address property.

I believe this is an issue with this beta feature.

In the meantime, I will follow up with our Engineers on this: https://github.com/auth0/lock/issues/2038

As soon as there are any updates, I will relay that information to you.

Thank you.

2 Likes

Thank you for your help so far, @rueben.tiow!