-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Making multiple Token calls with same grant type #39
Comments
@soofstad Just an update which i figured out, the cause of this is
i.e if we use React.StrictMode which makes react components render twice and due to this Token endpoint is called twice. |
This is how StrictMode works for react 18 at the moment. With no way of disabling it for specific components (ref: facebook/react#16362). Any suggestions to how this could be solved are welcome. |
Just to add to this: According to Dan Abramov (co-author of create-react-app), these duplicated requests should pose no issue, and only happen in development mode. If you try and bundle your app, and then run the bundled code, your requests should only happen once. This is apparently an intentional of React 18 Source: facebook/react#24502 (comment) |
@sebastianvitterso Yes, i agree. It only happens in development mode. |
Good to verify! I don't think there's anything this library can do to remedy this effect (considering it is a deliberate function of StrictMode). Feel free to close the issue, unless there's anything else. |
@sebastianvitterso Yes, you are right on this. Lets just wait for any update on Strict mode and I am closing this issue. If later on i found any fix or any update beneficial for this issue. I'll post. |
When i login, it makes two token call, with same request having same grant type: authorization_code
Sharing screen shots for reference
The text was updated successfully, but these errors were encountered: