Skip to content

Commit

Permalink
Move back_url conciliation within redux connect function
Browse files Browse the repository at this point in the history
  • Loading branch information
zaguiini committed Dec 23, 2024
1 parent 9e04096 commit 718900a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/signup/steps/user/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -753,13 +753,11 @@ export class UserStep extends Component {
return null;
}

const backUrl = this.props.backUrl?.startsWith( '/' ) ? this.props.backUrl : undefined;

// TODO: decouple hideBack flag from the flow name.
return (
<StepWrapper
backUrl={ backUrl }
allowBackFirstStep={ !! backUrl }
backUrl={ this.props.backUrl }
allowBackFirstStep={ !! this.props.backUrl }
flowName={ this.props.flowName }
stepName={ this.props.stepName }
headerText={ this.getHeaderText() }
Expand All @@ -777,8 +775,10 @@ export class UserStep extends Component {
const ConnectedUser = connect(
( state ) => {
const oauth2Client = getCurrentOAuth2Client( state );
const backUrl = get( getCurrentQueryArguments( state ), 'back_url' );

return {
backUrl: get( getCurrentQueryArguments( state ), 'back_url' ),
backUrl: backUrl?.startsWith( '/' ) ? backUrl : undefined,
oauth2Client: oauth2Client,
suggestedUsername: getSuggestedUsername( state ),
wccomFrom: getWccomFrom( state ),
Expand Down

0 comments on commit 718900a

Please sign in to comment.