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

Fix Google button disabled after first display #19357

Merged
merged 1 commit into from
Nov 6, 2017

Conversation

stephanethomas
Copy link
Contributor

@stephanethomas stephanethomas commented Oct 31, 2017

This pull request fixes #19289 to make sure the Continue with Google button on the Login page and on the User step of the signup flow is always enabled. Previously it would be enabled only the first time it would be displayed.

Login

screenshot

Signup

screenshot

Testing instructions

  1. Run git checkout fix/google-button and start your server, or open a live branch
  2. Open the Signup page in an incognito tab
  3. Assert that the Continue With Google button is enabled
  4. Click the Already have a WordPress.com account? Log in now. link in the footer
  5. Assert that the Continue With Google button on the Login page is enabled
  6. Assert that you can still log in with Google, and create a site

You should try again but starting the flow from the Login page this time.

Reviews

  • Code
  • Product

This fixes the case where the Google APIs client library is already loaded and initialized when the Google button is mounted again. This was failing because according to the documentation, the gapi.client.init function can be run multiple times, but the scope and clientId parameters cannot be provided multiple times, since the gapi.auth2 module can only be initialized once.

See https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiclientinitargs for more information.
@stephanethomas stephanethomas added Login [Feature] Signup & Account Creation All screens and flows for making a new WordPress.com account. [Type] Bug labels Oct 31, 2017
@matticbot
Copy link
Contributor

@stephanethomas stephanethomas self-assigned this Oct 31, 2017

return gapi; // don't try to return googleAuth here, it's a thenable but not a valid promise
} )
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The whole approach for fixing that issue was suggested here.

@yurynix
Copy link
Contributor

yurynix commented Nov 5, 2017

Works as described, code looks good 👍 LGTM
Thank you for working on that @stephanethomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Signup & Account Creation All screens and flows for making a new WordPress.com account. Login [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signup: Fix Google button disabled when logging in
4 participants