Used a single string for the error message when user enters wrong login credentials.

This commit is contained in:
Shridhar Goel 2018-05-11 19:34:04 +05:30
parent dcf43e6682
commit 7adf79c07d
2 changed files with 3 additions and 4 deletions

View file

@ -271,11 +271,11 @@ public class LoginActivity extends AccountAuthenticatorActivity {
showMessageAndCancelDialog(R.string.login_failed_network);
} else if (result.toLowerCase(Locale.getDefault()).contains("nosuchuser".toLowerCase()) || result.toLowerCase().contains("noname".toLowerCase())) {
// Matches nosuchuser, nosuchusershort, noname
showMessageAndCancelDialog(R.string.login_failed_username);
showMessageAndCancelDialog(R.string.login_failed_wrong_credentials);
emptySensitiveEditFields();
} else if (result.toLowerCase(Locale.getDefault()).contains("wrongpassword".toLowerCase())) {
// Matches wrongpassword, wrongpasswordempty
showMessageAndCancelDialog(R.string.login_failed_password);
showMessageAndCancelDialog(R.string.login_failed_wrong_credentials);
emptySensitiveEditFields();
} else if (result.toLowerCase(Locale.getDefault()).contains("throttle".toLowerCase())) {
// Matches unknown throttle error codes

View file

@ -46,8 +46,7 @@
<string name="add_title_toast">Please provide a title for this file</string>
<string name="share_description_hint">Description</string>
<string name="login_failed_network">Unable to login - network failure</string>
<string name="login_failed_username">Unable to login - please check your username and password</string>
<string name="login_failed_password">Unable to login - please check your username and password</string>
<string name="login_failed_wrong_credentials">Unable to login - please check your username and password</string>
<string name="login_failed_throttled">Too many unsuccessful attempts. Please try again in a few minutes.</string>
<string name="login_failed_blocked">Sorry, this user has been blocked on Commons</string>
<string name="login_failed_2fa_needed">You must provide your two factor authentication code.</string>