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(auth): simplify pending checkout #3471

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

miguelpeixe
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Automattic/newspack-blocks#1896 changes how the cart generation is handled for anonymous sessions. The cart is expected to be added to the session before authentication, allowing for this logic to be simplified.

The only stored value should now be the redirect URL so the checkout state can be recovered on ?checkout=1.

How to test the changes in this Pull Request:

Read more at Automattic/newspack-blocks#1896

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Contributor

@chickenn00dle chickenn00dle left a comment

Choose a reason for hiding this comment

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

Looks good for the most part. But FYI, we were using the isPendingCheckout method here as well to flag that content gated content shouldn't be reloaded during checkout:

if ( ev.detail.authenticated && ! window?.newspackReaderActivation?.isPendingCheckout() ) {

This will need to be updated.

@miguelpeixe
Copy link
Member Author

Thank you for catching that! Updated in 0945424

Copy link
Contributor

@chickenn00dle chickenn00dle left a comment

Choose a reason for hiding this comment

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

Great! Thanks for the update. Looks good!

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Oct 11, 2024
@miguelpeixe miguelpeixe merged commit bfe0b87 into epic/ras-acc Oct 11, 2024
8 checks passed
@miguelpeixe miguelpeixe deleted the fix/simplify-pending-checkout branch October 14, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ras-acc testing [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants