State does not match error coming back first time login

We are using React. We were using 9.10.4 and just upgraded to auth0-js to version 9.11.3 to see if it had any effect on the error we are being passed back.

We are getting an error that occurs upon user first time login. The error we receive in the parseHash((err, authResult) function is:

{“error”:“invalid_token”,“errorDescription”:“state does not match.”}

We have seen others posting similar problem but their resolution does not seem something related to us. We are using one domain. I have verified that the parseHash function is only being called once as I saw others suggesting a router or state issue having it being called twice. When this occurs I have verified through in the auth0 admin console that the auth0 logs say the user login is successful.

The user resolution is simply to log in a second time. Any thoughts on what we can troubleshoot to resolve? Thanks!

Upon further review, our domain was different. In first case we where using localhost (as that is the react default upon launching) and in callback case using synonym. In our case the fix was to set up an .env.development file with the host overridden to the synonym.

1 Like

Perfect you have figured it out!

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