Signup: preserve the ref parameter from login through account creation - #113577
Draft
bluefuton wants to merge 3 commits into
Draft
Signup: preserve the ref parameter from login through account creation#113577bluefuton wants to merge 3 commits into
bluefuton wants to merge 3 commits into
Conversation
|
WordPress.com
Automattic for Agencies
|
|
Looks like one of the E2E tests has failed. You can fix them following these steps:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
getSignupUrl()now carries arefquery parameter from the login page through to/start,/start/account, and/start/<signup_flow>.createAccount()forwards thatrefto/users/newand/users/social/new, so the referrer is recorded against the new account.refis only forwarded when it is a non-empty string after trimming; anything else (arrays, objects, whitespace) is dropped.Why are these changes being made?
Sign-ups that start on akismet.com arrive at WordPress.com with
?ref=…, but the parameter was dropped as soon as the user bounced through/log-inon the way to/start. Without it, the account-creation request had no record of where the user came from, so these sign-ups couldn't be attributed to Akismet.The change is deliberately generic: any product that sends users to log-in with a
refnow keeps it through to account creation, rather than adding an Akismet-specific path.Testing Instructions
/log-in?ref=akismetand click Create an account./start?ref=akismet(or/start/account?redirect_to=…&ref=akismetwhen a redirect is present).POSTto/users/new(or/users/social/newfor social sign-up) includesref=akismetin the payload./log-in?ref=and with norefat all — the sign-up URL and payload should be unchanged from trunk.yarn test-client client/lib/login/test/index.jsPre-merge Checklist