Replies: 2 comments 11 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hi @soofstad @sebastianvitterso I've updated the Next.js version and successfully included the route /authorized. The GitHub repository is https://github.com/tutehub/sample-reactjs/tree/develop/test-app. However, it's still stuck at /authorized?code= and only displays the page content. Kind regards, |
Beta Was this translation helpful? Give feedback.
-
I was previously using http://localhost:3000/authorized as the redirect_uri and it works fine.
Then I tried to ship the frontend ReactJs code to the VPS server and changed the redirect_uri to https://cowpte.com/authorized, but when login successfully, it did go back to https://cowpte.com/authorized?code=Lu5khRyTqn7SsXFipGKUB0YqQgqbuG03ldBJiajVyLrCL4PqxaVVe5XO-IFgbdqrATiLdWpal1kfDrYvX9tBzD9O4ZMz2gXRvS5OACjnO0XdHEGghc2HV883nkyA-YzN (code is for others, just demonstration here) and complain 404 Not Found.
I found similiar case is
After redirect back from auth provider with ?code, no token request is made
written on the https://www.npmjs.com/package/react-oauth2-code-pkceThe full description is here:
If you are using libraries that intercept any fetch()-requests made. For example @tanstack/react-query. That can cause issues for the AuthProviders token fetching. This can be solved by not wrapping the in any such library.
This could also happen if some routes in your app are not wrapped by the .
I didn't use third party that interface because localhost:3000 is totally fine.
I tried to include /authorized path in the route as well, but it still doesn't work.
I wonder how to solve this? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions