Skip to content

Commit

Permalink
Accept back_url query parameter in setup/hosted-site-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
zaguiini committed Dec 20, 2024
1 parent 9f2db5f commit 4def41d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { HOSTED_SITE_MIGRATION_FLOW } from '@automattic/onboarding';
import { useSearchParams } from 'react-router-dom';
import { type Flow } from './internals/types';
import siteMigration from './site-migration-flow';

const hostedSiteMigrationFlow: Flow = {
...siteMigration,
variantSlug: HOSTED_SITE_MIGRATION_FLOW,
isSignupFlow: true,
useLoginParams() {
const [ searchParams ] = useSearchParams();
const backUrl = searchParams.get( 'back_url' );

return {
extraQueryParams: {
...( backUrl ? { back_url: backUrl } : {} ),
},
};
},
};

export default hostedSiteMigrationFlow;

0 comments on commit 4def41d

Please sign in to comment.