Skip to content
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

fix: page reload when failing to close the popup #918

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Feb 19, 2024

Problem

The closing of the auth popup is affected by this https://developer.mozilla.org/en-US/docs/Web/API/Window/open#same-origin_policy since the authentication is done on a different origin.

The data communication still happens, but accessing the opener raised a DOM exception.

Because of this exception, the page refresh does not happen. Thus, the user does not see the account added, and it gets confusing because the message from the authorization popup tells him that a redirection needs to happen; otherwise, he needs to contact support.

Solution

By using a try block, even if the code fails to close the popup, the page reload will happen, and the user will see their account added.

Screenshots

2024-02-19_17-23-09.mp4

Testing

  • Try to add a Facebook account
  • After completing the step, the popup will remain, but the page will refresh
  • The refreshed page will contain the newly added account.

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Feb 19, 2024
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review February 19, 2024 15:25
@Soare-Robert-Daniel Soare-Robert-Daniel linked an issue Feb 19, 2024 that may be closed by this pull request
Copy link

Plugin build for 9a9a518 is ready 🛎️!

@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 0f07156 into development Feb 20, 2024
9 checks passed
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 9.0.25 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirection error due to array value
3 participants