Skip to content

Commit

Permalink
Merge pull request #3079 from wordpress-mobile/login/fix-sms-2fa-part-2
Browse files Browse the repository at this point in the history
[Login] Revert to using the /token endpoint for the authentication
  • Loading branch information
hichamboushaba committed Aug 16, 2024
2 parents 6c8bfe8 + 0f189a0 commit 863f213
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ private static Response<OauthResponse> 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");
}
}

Expand All @@ -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");
}
}

Expand Down

0 comments on commit 863f213

Please sign in to comment.