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
Google Sign-in: Migrate the pop-up flow to the new Google Identity Services API #64957
Google Sign-in: Migrate the pop-up flow to the new Google Identity Services API #64957
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~465 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~856 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 (~456 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. |
4694445
to
49e8f42
Compare
…to the responseHandler
49e8f42
to
8d3b779
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.
I did not see the consent screen when creating an account for a brand new Google account, which is good.
I have tested the mentioned cases: Verify that the current flow still works Verify that the new flow works Verifying that social sign-ups work |
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.
code looks good and tests works as expected
Proposed Changes
We are migrating to the new Google Identity Services API. This PR migrates the pop-up flow behind a feature flag so existing users won't be affected. The redirect flow will be handled by another PR.
Testing Instructions
In these instructions, we will link a WPCOM account to a Google account. This is the easier path to test as the others involve setting multiple Google accounts and that's less than desirable.
bin/calypso-secrets .config/secrets.php
in your WordPress.com sandbox;config/secrets.json
in your wp-calypso checkout;NODE_ENV=production CALYPSO_ENV=production yarn run build
;NODE_ENV=production HOST=wpcalypso.wordpress.com PORT=443 PROTOCOL=https CALYPSO_ENV=wpcalypso BUILD_TRANSLATION_CHUNKS=true node build/server.js
;wpcalypso.wordpress.com
to127.0.0.1
;document.cookie='G_AUTH2_MIGRATION=informational'
.Keep the DevTools open to assert a few details below...
Verify that the current flow still works
Connect
and choose a Google account not yet linked to any WPCOM account.It should connect the account successfully. You should also be able to see that
/me/social-login/connect
was called successfully in the network tab in the DevTools.Verify that the new flow works
Disconnect
to unlink the previously connected Google account;Config flag enabled via URL: migration/sign-in-with-google
message in the console;Connect
and choose an account not yet linked to any WPCOM account.It should connect the account successfully. The network tab in the DevTools should show that both the calls to
/wp-login.php?action=exchange-social-auth-code
and/me/social-login/connect
were issued successfully.Verifying that social sign-ups work
The new flow should work all across the application since they're using the same component. If you'd like to try a sign-up instead of a social connection, here's how you can do so:
Config flag enabled via URL: migration/sign-in-with-google
message in the console;Continue With Google
and choose an account not yet registered to WPCOM.You should be redirected to the
/start/domains
page. In the background, requests to/wp-login.php?action=exchange-social-auth-code
and/users/social/new
should've been successfully issued.Related to #64788.