I know this is a late reply, but have you solved this problem yet? I also deployed React app (with Auth0 integrated) on Render, and I also ran into the same problem as you, that is, after user logged in, they are not redirected to the assigned callback URL as specified in Auth0 Application because the redirect URL has the query parameters ?code…&state…and in the browser’s console, it says 404 Not Found Error.
I solved this problem successfully. The way I did was:
. In the Render, go to your Static site service (just like the way you deployed the Frontend React) → on your left, there’s a tab called Redirects/Rewrites. And you will specify like this:
(This will solve the problem with 404 Not Found, because you need to tell Render to redirect the inbound request to the index.html, which is where your React app is served. Otherwise, it will says 404 Not Found the file that your React app is served to render/display the contents)
. In your Frontend React code, if you use Auth0Provider in main.jsx, you need to use like this:
That is, you should use the template string (the backticks) instead of string concatenation with the “+” sign. I do not know why, but I have tried many times and by trial-and-error, I find that when I use string concatenation in the redirect_uri, then the redirect_uri is different to what I have assigned in Auth0 Dashboard. So I find out that using Template String with backticks ``, solved the problem successfully.
After doing 2 steps above, I have solved the problem successfully. I do not know whether you have solved it successfully yet, but if not, please give it a try, because it works perfectly on my side. Sorry for the late reply…
If your main page is on /, so you can set the redirect_uri in the Auth0Provider to be ${window.location.origin} (using the backticks ``). That’s all, you can give it a try. Remember to add this redirect_uri to Auth0 Application Dashboard, and after you make the changes in your code, remember to deploy this code again so that the changes can be reflected in production