diff --git a/client/blocks/signup-form/passwordless.jsx b/client/blocks/signup-form/passwordless.jsx index f2ecd4c90734d3..b6478424e0b408 100644 --- a/client/blocks/signup-form/passwordless.jsx +++ b/client/blocks/signup-form/passwordless.jsx @@ -169,10 +169,6 @@ class PasswordlessSignupForm extends Component { const { flowName, queryArgs = {} } = this.props; const { redirect_to, oauth2_client_id, oauth2_redirect } = queryArgs; - if ( this.props.onCreateAccountSuccess ) { - return this.props.onCreateAccountSuccess( userData ); - } - recordRegistration( { userData, flow: flowName, @@ -187,6 +183,10 @@ class PasswordlessSignupForm extends Component { ? { oauth2_client_id, oauth2_redirect } : { redirect: redirect_to } ), } ); + + if ( this.props.onCreateAccountSuccess ) { + return this.props.onCreateAccountSuccess( userData ); + } }; submitStep = ( data ) => { diff --git a/client/blocks/signup-form/signup-form-social-first.tsx b/client/blocks/signup-form/signup-form-social-first.tsx index 52cc70f29a19c5..8be6e5af4929f4 100644 --- a/client/blocks/signup-form/signup-form-social-first.tsx +++ b/client/blocks/signup-form/signup-form-social-first.tsx @@ -35,6 +35,7 @@ interface SignupFormSocialFirst { extra: { first_name: string; last_name: string; username_hint: string }; } | null ) => void; + onCreateAccountSuccess?: ( data: AccountCreateReturn ) => void; queryArgs: QueryArgs; userEmail: string; notice: JSX.Element | false; @@ -69,6 +70,7 @@ const SignupFormSocialFirst = ( { logInUrl, socialServiceResponse, handleSocialResponse, + onCreateAccountSuccess, queryArgs, userEmail, notice, @@ -175,6 +177,7 @@ const SignupFormSocialFirst = ( { ); } } } + onCreateAccountSuccess={ onCreateAccountSuccess } { ...gravatarProps } />