-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WooCommerce NUX] Fix incorrect redirection for existing user #87042
Conversation
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~583 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~1826 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~948 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chihsuan I think this might be related to the PR, where another error looks broken (my account had 2fa)
There's also this odd looking prompt when the social login failed (I disconnected sandbox so public-api isn't accessible):
Otherwise this was testing well!
71fd46f
to
ee9efac
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested well! I have minor comments but pre-approving
@@ -233,7 +234,20 @@ class SignupForm extends Component { | |||
|
|||
this.props.createSocialUserFailed( socialInfo, userExistsError, 'signup' ); | |||
|
|||
page( login( { redirectTo: this.props.redirectToAfterLoginUrl } ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a potential of unintended behaviour since we're no longer exclusively use this.props.redirectToAfterLoginUrl
, especially on non-Woo flows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! I think it's safe. For signup flow, only Woo users will reach this logic.
wp-calypso/client/signup/steps/user/index.jsx
Line 590 in 23d8e11
shouldDisplayUserExistsError={ ! isWooOAuth2Client( oauth2Client ) } |
And we still use this.props.redirectToAfterLoginUrl
in the getLoginLink
.
wp-calypso/client/blocks/signup-form/index.jsx
Lines 491 to 503 in f4c142f
getLoginLink( { emailAddress } = {} ) { | |
return login( { | |
emailAddress, | |
isJetpack: this.isJetpack(), | |
from: this.getLoginLinkFrom(), | |
redirectTo: this.props.redirectToAfterLoginUrl, | |
locale: this.props.locale, | |
oauth2ClientId: this.props.oauth2Client && this.props.oauth2Client.id, | |
wccomFrom: this.props.wccomFrom, | |
isWhiteLogin: this.props.isReskinned, | |
signupUrl: window.location.pathname + window.location.search, | |
} ); | |
} |
Moreover, I believe that this login()
call without any other additional parameters is a bug for all flows. Without passing any additional parameters, users will be redirected to the WP.com login screen and lose context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks for clearing that up!
Moreover, I believe that this login() call without any other additional parameters is a bug for all flows. Without passing any additional parameters, users will be redirected to the WP.com login screen and lose context.
Great point, I wonder if there's folks to tag about this 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tested well 👍 🚀
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
b1ade37
to
d56b81e
Compare
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/11264016 Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @chihsuan for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
Related to #86884
When a user tries to sign up using Google or Apple, and their email matches an existing account that hasn't been connected yet, the user will be redirected to Woo's login screen and it will display a warning notice.
Figma: 4ixWMlzrxllx93tSFsCW6k-fi-5037_90936
Proposed Changes
Testing Instructions
You already have a WordPress.com account with this email address. Add your password to log in or create a new account.
figma: 4ixWMlzrxllx93tSFsCW6k-fi-5037_90936Pre-merge Checklist