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

DIFM Signup: Redirect user to /home after they cancel DIFM checkout #95183

Merged
merged 1 commit into from
Oct 7, 2024

Commits on Oct 7, 2024

  1. Redirect user to /home after they cancel DIFM checkout

    This diff hijacks the 'website-content' step in order to check the value
    of the `?skippedCheckout=1` query param. If it's set then we go straight
    to My Home otherwise an error is shown - since the purchase is never
    completed, the DIFM data isn't set up and that's why there's an error on
    this page.
    
    The checkout page usually supports both `?redirect_to` and `?cancel_to`
    query params that let you go to a different location if the user cancels
    the checkout. Unfortunately the signup framework only gives the ability
    to set a single "destination" for a flow.
    https://github.com/Automattic/wp-calypso/blob/cf0aa1a007213a6cfcf40b420acd7f4b9c1d8441/client/signup/config/flows-pure.js#L506
    
    For reference, the `?skippedCheckout=1` param is set here:
    https://github.com/Automattic/wp-calypso/blob/cf0aa1a007213a6cfcf40b420acd7f4b9c1d8441/client/signup/config/flows.js#L58
    p-jackson committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    dd26608 View commit details
    Browse the repository at this point in the history