From c3f0584cc2f4df64e22088558a8b361e1255fd4a Mon Sep 17 00:00:00 2001 From: moon Date: Mon, 30 Sep 2024 14:32:54 -0700 Subject: [PATCH] Add plugin_name param to the login link --- client/jetpack-connect/auth-form-header.jsx | 1 + client/lib/paths/login/index.js | 5 +++++ client/state/selectors/is-woocommerce-core-profiler-flow.ts | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/jetpack-connect/auth-form-header.jsx b/client/jetpack-connect/auth-form-header.jsx index b22cceb863a4b..163e635dc2b31 100644 --- a/client/jetpack-connect/auth-form-header.jsx +++ b/client/jetpack-connect/auth-form-header.jsx @@ -176,6 +176,7 @@ export class AuthFormHeader extends Component { isJetpack: true, redirectTo: window.location.href, from: this.props.authQuery.from, + plugin_name: this.props.authQuery.plugin_name, } ) } /> ), diff --git a/client/lib/paths/login/index.js b/client/lib/paths/login/index.js index f5abb671949cf..e528a6d121307 100644 --- a/client/lib/paths/login/index.js +++ b/client/lib/paths/login/index.js @@ -42,6 +42,7 @@ export function login( { usernameOnly = undefined, gravatarFrom = undefined, gravatarFlow = undefined, + plugin_name = undefined, } = {} ) { let url = '/log-in'; @@ -121,5 +122,9 @@ export function login( { url = addQueryArgs( { gravatar_flow: '1' }, url ); } + if ( plugin_name ) { + url = addQueryArgs( { plugin_name }, url ); + } + return url; } diff --git a/client/state/selectors/is-woocommerce-core-profiler-flow.ts b/client/state/selectors/is-woocommerce-core-profiler-flow.ts index e556171a64fdc..fdab010828c24 100644 --- a/client/state/selectors/is-woocommerce-core-profiler-flow.ts +++ b/client/state/selectors/is-woocommerce-core-profiler-flow.ts @@ -15,7 +15,7 @@ export const isWooCommerceCoreProfilerFlow = ( state: AppState ): boolean => { get( getInitialQueryArguments( state ), 'from' ) === 'woocommerce-core-profiler' || get( getCurrentQueryArguments( state ), 'from' ) === 'woocommerce-core-profiler'; - const allowedPluginNames = [ 'woocommerce-payment' ]; + const allowedPluginNames = [ 'woocommerce-payments' ]; const isPluginNameAllowed = allowedPluginNames.includes( get( getInitialQueryArguments( state ), 'plugin_name' ) as string