Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes oAuth redirect behaviour in development #1275

Merged
merged 5 commits into from
Jun 22, 2023
Merged

Conversation

infomiho
Copy link
Contributor

Fixes #1272

Based on https://stackoverflow.com/questions/73732474/handling-oauth-with-react-18-useeffect-hook-running-twice

Fixing it this way is not recommended by the docs, but they don't offer any alternatives for this particular use case (oauth redirect page): https://react.dev/learn/synchronizing-with-effects#how-to-handle-the-effect-firing-twice-in-development

infomiho added 3 commits June 21, 2023 16:07
Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Copy link
Member

@Martinsos Martinsos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@infomiho great! I get that this is tricky hm, but seems like good fix for now.
Could you maybe just add a comment in the code, desribing what you commented in the PR (that we did it because of StrictMode and don't know of a better solution at the moment)?

infomiho added 2 commits June 22, 2023 10:30
Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
@infomiho infomiho merged commit e3873a6 into main Jun 22, 2023
@infomiho infomiho deleted the miho-oauth-redirect-fix branch June 22, 2023 08:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Social login callback page sends the token twice
2 participants