Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

[Woo] Fix Site Credentials login when site discovery fails and site has http to https redirection #3053

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

hichamboushaba
Copy link
Member

@hichamboushaba hichamboushaba commented Jul 17, 2024

Closes: woocommerce/woocommerce-android#11931

This PR updates the logic of site discovery used to infer the SiteModel#wpApiRestUrl to use https by default when the automatic discovery fails, this fixes login issues for sites with non-working discovery (non-standard Link header) and http to https redirection, for more information, please check peaMlT-Kc-p2

For tests, please check the PR woocommerce/woocommerce-android#12033

@hichamboushaba hichamboushaba marked this pull request as ready for review July 17, 2024 15:37
@JorgeMucientes JorgeMucientes self-assigned this Jul 17, 2024
Comment on lines +13 to +14
// TODO investigate the possibility to use `/?rest_route=` instead,
// `/wp-json` works only when permalinks are enabled, where `/?rest_route=` works without them
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this TODO to keep track of the explained issue, I also logged this Github issue to keep track of it woocommerce/woocommerce-android#12043

@JorgeMucientes JorgeMucientes merged commit 46e6111 into trunk Jul 17, 2024
13 checks passed
@JorgeMucientes JorgeMucientes deleted the fix-wpapi-login-http branch July 17, 2024 22:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Login failures when using site credentials due to URL redirections.
2 participants