Hi @pingpongdoctor,
Thanks for the question.
The Auth0 React SDK implements the auth code + PKCE flow in the loginWithRedirect method. I would suggest simply using the SDK and not implementing the same flow again manually.
Is there a certain reason why you are also implementing it after the fact?