Created
January 24, 2022 02:56
-
-
Save p-jackson/27699b9360bedd26614d32067659aa32 to your computer and use it in GitHub Desktop.
Add `user_id` to signup dependencies
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
diff --git a/client/lib/signup/step-actions/index.js b/client/lib/signup/step-actions/index.js | |
index 92f0017eed..62c0680aec 100644 | |
--- a/client/lib/signup/step-actions/index.js | |
+++ b/client/lib/signup/step-actions/index.js | |
@@ -153,7 +153,7 @@ function getNewSiteParams( { | |
const siteSegment = getSiteTypePropertyValue( 'slug', siteType, 'id' ); | |
const siteTypeTheme = getSiteTypePropertyValue( 'slug', siteType, 'theme' ); | |
const selectedDesign = get( signupDependencies, 'selectedDesign', false ); | |
- const userId = getCurrentUserId( state ); | |
+ const userId = signupDependencies.user_id || getCurrentUserId( state ); | |
const shouldHideFreePlan = get( getSignupDependencyStore( state ), 'shouldHideFreePlan', false ); | |
const useAutoGeneratedBlogName = shouldHideFreePlan; | |
@@ -683,6 +683,7 @@ export function createAccount( | |
username, | |
marketing_price_group, | |
plans_reorder_abtest_variation, | |
+ user_id: userId, | |
...bearerToken, | |
}; | |
diff --git a/client/signup/config/steps-pure.js b/client/signup/config/steps-pure.js | |
index dda165c376..94b48bd285 100644 | |
--- a/client/signup/config/steps-pure.js | |
+++ b/client/signup/config/steps-pure.js | |
@@ -141,6 +141,7 @@ export function generateSteps( { | |
'marketing_price_group', | |
'plans_reorder_abtest_variation', | |
'redirect', | |
+ 'user_id', | |
], | |
optionalDependencies: [ 'plans_reorder_abtest_variation', 'redirect' ], | |
props: { | |
@@ -160,6 +161,7 @@ export function generateSteps( { | |
'marketing_price_group', | |
'plans_reorder_abtest_variation', | |
'allowUnauthenticated', | |
+ 'user_id', | |
], | |
optionalDependencies: [ | |
'bearer_token', | |
@@ -167,6 +169,7 @@ export function generateSteps( { | |
'marketing_price_group', | |
'plans_reorder_abtest_variation', | |
'allowUnauthenticated', | |
+ 'user_id', | |
], | |
props: { | |
isSocialSignupEnabled: config.isEnabled( 'signup/social' ), | |
@@ -403,6 +406,7 @@ export function generateSteps( { | |
'oauth2_redirect', | |
'marketing_price_group', | |
'plans_reorder_abtest_variation', | |
+ 'user_id', | |
], | |
optionalDependencies: [ 'plans_reorder_abtest_variation' ], | |
}, | |
@@ -418,6 +422,7 @@ export function generateSteps( { | |
'oauth2_redirect', | |
'marketing_price_group', | |
'plans_reorder_abtest_variation', | |
+ 'user_id', | |
], | |
optionalDependencies: [ 'plans_reorder_abtest_variation' ], | |
props: { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment