Skip to content

Commit

Permalink
Add plugin_name param to the login link
Browse files Browse the repository at this point in the history
  • Loading branch information
moon0326 committed Sep 30, 2024
1 parent 80a9c95 commit c3f0584
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/jetpack-connect/auth-form-header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
} ) }
/>
),
Expand Down
5 changes: 5 additions & 0 deletions client/lib/paths/login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function login( {
usernameOnly = undefined,
gravatarFrom = undefined,
gravatarFlow = undefined,
plugin_name = undefined,
} = {} ) {
let url = '/log-in';

Expand Down Expand Up @@ -121,5 +122,9 @@ export function login( {
url = addQueryArgs( { gravatar_flow: '1' }, url );
}

if ( plugin_name ) {
url = addQueryArgs( { plugin_name }, url );
}

return url;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3f0584

Please sign in to comment.