Fix issue case sensitive issue

This commit is contained in:
Thomas 2020-09-12 18:05:55 +02:00
parent cb9f8605d5
commit 94b969c428
1 changed files with 15 additions and 2 deletions

View File

@ -234,8 +234,21 @@ public class LoginActivity extends AppCompatActivity {
String responseLogin = new HttpsConnection(LoginActivity.this).post("https://" + finalInstance + oauthUrl, 30, parameters, null);
proceedLogin(responseLogin, host);
} catch (final Exception e) {
parameters.remove("username");
parameters.put("username", login_uid.getText().toString().trim().toLowerCase());
parameters.clear();
parameters.put(Helper.CLIENT_ID, sharedpreferences.getString(Helper.CLIENT_ID, null));
parameters.put(Helper.CLIENT_SECRET, sharedpreferences.getString(Helper.CLIENT_SECRET, null));
parameters.put("grant_type", "password");
try {
parameters.put("username", URLEncoder.encode(login_uid.getText().toString().toLowerCase().trim(), "UTF-8"));
} catch (UnsupportedEncodingException e2) {
parameters.put("username", login_uid.getText().toString().toLowerCase().trim());
}
try {
parameters.put("password", URLEncoder.encode(login_passwd.getText().toString(), "UTF-8"));
} catch (UnsupportedEncodingException e2) {
parameters.put("password", login_passwd.getText().toString());
}
parameters.put("scope", "user");
try {
String responseLogin = new HttpsConnection(LoginActivity.this).post("https://" + finalInstance + oauthUrl, 30, parameters, null);
proceedLogin(responseLogin, host);