Login: Replace endpoint that fetches site info when using a site address to login#12940
Merged
renanferrari merged 13 commits intodevelopfrom Sep 17, 2020
Merged
Conversation
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
Generated by 🚫 dangerJS |
|
You can test the changes on this Pull Request by downloading the APK here. |
d069324 to
2debdef
Compare
khaykov
approved these changes
Sep 16, 2020
This was referenced Sep 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12832
When logging in using a site address, we used to make a call to
/sites/$siteto fetch more info about the site and to determine if we should treat it as a WordPress.com site or a self-hosted one.That endpoint did not work well with private sites, which would cause issues for users that had custom domains and 2FA enabled (you can read more about it in the linked issue or in this internal ref: pbArwn-16v-p2).
This PR replaces the usage of that endpoint with
/connect/site-info, which allows us to better handle those situations. This endpoint was already being implemented in the LoginFlow library, but was only used by the Woo app. I tried to reuse some of that code, while also making sure to keep the existing behavior regarding how to treat different site types (WordPress.com, Jetpack and self-hosted).To test
You can test the following scenarios by creating sites with jurassic.ninja or by using a pre-configured test site.
Main Scenario
Private WordPress.com site with custom domain and 2FA enabled
Secondary Scenarios
WordPress.com, Self-Hosted or Jetpack site
Note: While working on this PR, it was noted that Atomic and Jetpack sites are being treated as Self-Hosted sites as opposed to WP.com sites, which is the expected behavior. This will be addressed in a follow-up PR.
HTTP Auth
Self-Signed SSL
PR submission checklist:
RELEASE-NOTES.txtif necessary.