Skip to content

Commit

Permalink
Replace the URL of the authentication request
Browse files Browse the repository at this point in the history
The token endpoint results in sending the SMS code automatically without having to use a second request using TwoFactorRequest
  • Loading branch information
hichamboushaba committed Aug 12, 2024
1 parent 2710ee2 commit 7d57367
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +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(WITH_AUTH_TYPES, "true");
mParams.put("wpcom_supports_2fa", "true");
}
}
Expand Down

0 comments on commit 7d57367

Please sign in to comment.