Skip to content
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

Add sso options to wpcc signup flow #68080

Merged
merged 15 commits into from Sep 21, 2022
Merged

Conversation

chihsuan
Copy link
Member

Proposed Changes

63-gh-woocommerce/team-ghidorah

This PR adds Apple and Google SSO options to wpcc signup flow for woocommerce.com.

Changes (please also check commits):

  • Set isSocialSignupEnabled true for wpcc flow to show social signup form
  • Update logic to perform regular login after SSO signup in the wpcc flow
  • Set redirect_uri and save redirectToAfterLoginUrl for Apple SSO in the wpcc flow
  • Persist URL query string in apple SSO "state" to show the correct UI.
  • Update oauth-client form style for woo

Testing Instructions

See "Testing Instructions" in #64957 to set up a working wpcalypso.wordpress.com environment on your local machine.

Test Google Signup

  1. Make sure you're logged out WordPress.com account.
  2. Go to https://woocommerce.com/
  3. Click Get Started
  4. Replace the URL host with wpcalypso.wordpress.com
  5. Click on "Continue with Google" button.
  6. Complete the Google connect flow.
  7. Observe that you're logged
  8. If it's a new account, you should be redirected to https://woocommerce.com/start Otherwise, you will be redirected to https://woocommerce.com/my-dashboard/. (Note that the redirection logic is implemented in the woocmmerce.com end.)
Screen.Recording.2022-09-08.at.15.17.46.mov

Test Apple Signup

  1. Make sure you're logged out WordPress.com account.
  2. Go to https://woocommerce.com/
  3. Click Get Started
  4. Replace the the URL host with wpcalypso.wordpress.com
  5. Click on "Continue with Apple" button.
  6. Complete the Apple connect flow.
  7. Observe that you're logged
  8. If it's a new account, you should be redirected to https://woocommerce.com/start Otherwise, you will be redirected to https://woocommerce.com/my-dashboard/.
Screen.Recording.2022-09-08.at.15.19.53.mov

Pre-merge Checklist

@chihsuan chihsuan marked this pull request as ready for review September 21, 2022 08:39
@chihsuan chihsuan requested a review from a team September 21, 2022 08:39
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 21, 2022
@chihsuan chihsuan self-assigned this Sep 21, 2022
@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~43 bytes added 📈 [gzipped])

name         parsed_size           gzip_size
entry-login       +144 B  (+0.0%)      +44 B  (+0.0%)
entry-main         +36 B  (+0.0%)       +2 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~305 bytes added 📈 [gzipped])

name             parsed_size           gzip_size
jetpack-connect       +846 B  (+0.1%)     +266 B  (+0.1%)
accept-invite         +846 B  (+0.2%)     +266 B  (+0.3%)
security              +108 B  (+0.0%)      +39 B  (+0.0%)

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 (~256 bytes added 📈 [gzipped])

name                                           parsed_size           gzip_size
async-load-signup-steps-user                        +775 B  (+0.4%)     +246 B  (+0.4%)
async-load-design-blocks                            +108 B  (+0.0%)      +41 B  (+0.0%)
async-load-calypso-blocks-inline-help-popover        +36 B  (+0.0%)      +10 B  (+0.0%)

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@chihsuan chihsuan requested a review from a team September 21, 2022 08:43
@chihsuan
Copy link
Member Author

Confirmed Pre-Release E2E Tests (Web app) passed.

Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚢

@chihsuan chihsuan merged commit ddae692 into trunk Sep 21, 2022
@chihsuan chihsuan deleted the add/sso-options-to-wpcc-signup-flow branch September 21, 2022 09:11
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 21, 2022
chihsuan added a commit that referenced this pull request Sep 21, 2022
@chihsuan chihsuan restored the add/sso-options-to-wpcc-signup-flow branch September 21, 2022 09:52
chihsuan added a commit that referenced this pull request Sep 21, 2022
villanovachile pushed a commit that referenced this pull request Sep 27, 2022
* Perform regular login after SSO signup in the wpcc flow

The logic was added in bba4f23

However, it doesn't not automatically log the user anymore so remove the
logic

* Update oauth-client form style for woo

* Enable social signup for wpcc flow

* Update redirect uri and save redirectToAfterLoginUrl for wpcc flow with Apple login

* Persist url query string in apple sso state

So that we can show the same UI after redirecting back to the calypso

* Make sure the tos link display with woo color

* Make social button width the same size

* Catch sessionStorage.setItem error

* Use winodw.location.origin directly for getRedirectUri instead

* Redirect apple login to state.originalUrlPath

* Fix social response handling

* Make originalUrlPath configurable

* Make queryString configurable

* Update woo social signup enable logic and comment

* Fix incorrect apple callback redirect query string
villanovachile pushed a commit that referenced this pull request Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants