Skip to content

Commit

Permalink
Add redirect to /log-in page when user is already logged in for WCCOM…
Browse files Browse the repository at this point in the history
… login flow (#95353)

* Add redirect to /log-in page when user is already logged in

* Ensure return empty component
  • Loading branch information
ilyasfoo authored Oct 16, 2024
1 parent 6d1c938 commit b129137
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/signup/steps/user/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import config from '@automattic/calypso-config';
import page from '@automattic/calypso-router';
import { localizeUrl } from '@automattic/i18n-utils';
import { isHostingSignupFlow, isNewsletterFlow } from '@automattic/onboarding';
import { WPCC } from '@automattic/urls';
Expand Down Expand Up @@ -747,6 +748,11 @@ export class UserStep extends Component {
return this.renderGravatarSignupStep();
}

if ( isWooOAuth2Client( this.props.oauth2Client ) && this.props.userLoggedIn ) {
page( this.getLoginUrl() );
return null;
}

// TODO: decouple hideBack flag from the flow name.
return (
<StepWrapper
Expand Down

0 comments on commit b129137

Please sign in to comment.