Hello, I have been following this guide: https://auth0.com/blog/authenticating-your-first-react-app/ , it is from 2019 so I thought it would be a good candidate for a new implementation.
I am encountering an error when calling the
loginWithRedirect function from the login button. First I want to mention that it seems pretty good most of the way, the client id is correct, the redirect url is correct and accepted by auth zero, I even end up at the right https://app-name.eu.auth0.com/login?state=xxxxx and I can tell it is the right one as the background color is styled with our custom color… But here I am getting an error:
It looks to me like the login page is trying to parse the url which seem really messed up, like the entire click event from the login button is encoded into the url.
When looking at the code I am not exactly sure that I understand this:
loginWithRedirect: (...p) => auth0Client.loginWithRedirect(...p),
For debugging experiment I have tried to replace the …p argument in the final call with ‘hello world’
loginWithRedirect: (...p) => auth0Client.loginWithRedirect('hello world'),
which does seem to have impact on the generated url but still throwing JSON error
Uncaught SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at login?0=h&1=e&2=l&3=l&4=o&5= &6=w&7=o&8=r&9=l&10=d&state=…
Any ideas what I am doing wrong here ?