Auth0 requires two login attempts to Authenticate

I am using react and set up Auth0 with lock based on this github:

The problem is that my first login attempt never works but the second one always does. On first attempt I am prompted to “Log in with Google or give…” but when I login the app fails to authenticate and the Auth0 window closes, clearly no authentication has occurred but there is nothing noticeably wrong on screen. The console has two 404 not found errors when I launch the Auth0 window but there are not any errors after the login attempt fails.

After the Auth0 window exits I press my login button and try again but this time the window reads “Last time you logged in with…” and I log in normally and my app works as expected. No errors anywhere.

Having difficulty debugging because nothing changes between the failed and successful log in attempts. There could be something wrong with the code I got from GitHub but I have not found any other helpful React + Auth0 Lock examples. Any help is appreciated, thank you.

Hello @tanner,

Welcome to the Community. I don’t have an immediate answer for you, but I would suggest starting with the official React quick start from Auth0:


I strongly recommend @markd 's suggestion. the Github sample you linked hasn’t been updated in 2 years. React and Auth0 has come a long way since then so it is best to use our official quickstart guide.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.