woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

Show generic error when fetching site-url/wp-json namespaces is empty during site credentials login #12813

Open JorgeMucientes opened 1 week ago

JorgeMucientes commented 1 week ago

Currently, if site namespaces are hidden due to some hosting provider configuration or security plugin, if the user attempt to log into the app they'll see the following error even for WooCommerce sites:

The error is misleading. The proposal is to update this piece of code from SiteWPAPIRestClient.kt:

                    hasWooCommerce = response?.namespaces?.any {
                        it.startsWith(WOO_API_NAMESPACE_PREFIX)
                    } ?: false

and simply return an error if response?.namespaces is empty.

dangermattic commented 1 week ago

🚫 Please add a type label (e.g. type: enhancement) and a feature label (e.g. feature: stats) to this issue.