From 0f189a0307b77a315df19c38292f8d5a86e3f0d5 Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Tue, 13 Aug 2024 16:51:18 +0100 Subject: [PATCH] Revert to using the `/token` endpoint for the login --- .../android/fluxc/network/rest/wpcom/auth/Authenticator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/auth/Authenticator.java b/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/auth/Authenticator.java index 08378a0aa8..ac0b045df9 100644 --- a/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/auth/Authenticator.java +++ b/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/auth/Authenticator.java @@ -213,12 +213,12 @@ private static Response handleDataObjectResponse(Cache.Entry head public static class PasswordRequest extends OauthRequest { public PasswordRequest(String appId, String appSecret, String username, String password, Listener listener, ErrorListener errorListener) { - super(LOGIN_BASE_ENDPOINT, appId, appSecret, listener, errorListener); + super(TOKEN_ENDPOINT, appId, appSecret, listener, errorListener); mParams.put(USERNAME_PARAM_NAME, username); mParams.put(PASSWORD_PARAM_NAME, password); mParams.put(GRANT_TYPE_PARAM_NAME, PASSWORD_GRANT_TYPE); - mParams.put(GET_BEARER_TOKEN, "true"); mParams.put("wpcom_supports_2fa", "true"); + mParams.put(WITH_AUTH_TYPES, "true"); } } @@ -235,6 +235,7 @@ public TwoFactorRequest(String appId, String appSecret, String username, String mParams.put("wpcom_resend_otp", "true"); } mParams.put("wpcom_supports_2fa", "true"); + mParams.put(WITH_AUTH_TYPES, "true"); } }