Describe the bug
Generic error "An error occurred" is shown when I enter an invalid password for my WordPress.com account during Google SSO login.
To Reproduce
Steps to reproduce the behavior:
Use an account which you haven't connected to Google SSO yet.
Start the Google SSO login flow in the Android app.
The login flow prompts you to enter the WordPress.com account password one time so it can cross-connect your account with Google SSO.
Enter a wrong password and notice a generic error - "Unexpected error".
Logs
```
NetworkUtility.shouldRetryException: Unexpected response code 400 for https://wordpress.com/wp-login.php?action=login-endpoint
2024-07-08 12:01:23.568 30914-30914 WordPress-API com.woocommerce.android.dev E Authentication error
2024-07-08 12:01:25.355 30914-30914 WordPress-API com.woocommerce.android.dev E No value for error_description
org.json.JSONException: No value for error_description
at org.json.JSONObject.get(JSONObject.java:398)
at org.json.JSONObject.getString(JSONObject.java:559)
at org.wordpress.android.fluxc.network.rest.wpcom.auth.Authenticator.volleyErrorToErrorMessage(Authenticator.java:370)
at org.wordpress.android.fluxc.store.AccountStore.handleAuthError(AccountStore.java:1381)
at org.wordpress.android.fluxc.store.AccountStore.$r8$lambda$9CqiUl1UxTWg-HPqHwpDiUNqr84(Unknown Source:0)
at org.wordpress.android.fluxc.store.AccountStore$$ExternalSyntheticLambda3.onErrorResponse(Unknown Source:2)
at com.android.volley.Request.deliverError(Request.java:648)
at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:104)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
2024-07-08 12:01:25.356 30914-30914 WordPress-API com.woocommerce.android.dev E onAuthenticationChanged has error: GENERIC_ERROR - null
```
Screenshots
Notice the API response contains more information about the error, however, the app expects a different field in the json.
Expected behavior
More precise error is shown - considering this flow is encountered after we have already verified the user has access to the Google SSO, I believe it is safe to display "Incorrect password" error (even "incorrect username or password" error is definitely an improvement to the current state though).
The iOS app works as expected => it displays “It seems like you’ve entered an incorrect password. Want to give it another try?”. peaMlT-Ko#comment-1786
Describe the bug Generic error "An error occurred" is shown when I enter an invalid password for my WordPress.com account during Google SSO login.
To Reproduce Steps to reproduce the behavior:
Logs
Screenshots Notice the API response contains more information about the error, however, the app expects a different field in the json.
Expected behavior More precise error is shown - considering this flow is encountered after we have already verified the user has access to the Google SSO, I believe it is safe to display "Incorrect password" error (even "incorrect username or password" error is definitely an improvement to the current state though).
WordPress Environment