summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Dashboard.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/SessionDialog.java13
2 files changed, 11 insertions, 4 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
index c043821f..14d79bc0 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
@@ -426,6 +426,8 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
} else if(resultCode == ProviderAPI.SUCCESSFUL_LOGIN) {
downloadVpnCertificate();
} else if(resultCode == ProviderAPI.FAILED_LOGIN) {
+ if(provider.getName().equalsIgnoreCase("riseup"))
+ resultData.putBoolean(SessionDialog.ERRORS.CONFUSING_CREDENTIALS.toString(), true);
sessionDialog(resultData);
} else if(resultCode == ProviderAPI.SUCCESSFUL_LOGOUT) {
if(switching_provider) switchProvider();
diff --git a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java
index 9025564b..e32bca8e 100644
--- a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java
+++ b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java
@@ -48,8 +48,11 @@ public class SessionDialog extends DialogFragment{
final public static String USERNAME = "username";
final public static String PASSWORD = "password";
- final public static String USERNAME_MISSING = "username missing";
- final public static String PASSWORD_INVALID_LENGTH = "password_invalid_length";
+ public static enum ERRORS {
+ USERNAME_MISSING,
+ PASSWORD_INVALID_LENGTH,
+ CONFUSING_CREDENTIALS
+ }
@InjectView(R.id.user_message)
TextView user_message;
@@ -105,13 +108,15 @@ public class SessionDialog extends DialogFragment{
private void setUp(Bundle arguments) {
is_eip_pending = arguments.getBoolean(EipFragment.IS_PENDING, false);
- if (arguments.containsKey(PASSWORD_INVALID_LENGTH))
+ if (arguments.containsKey(ERRORS.PASSWORD_INVALID_LENGTH.toString()))
password_field.setError(getString(R.string.error_not_valid_password_user_message));
+ else if(arguments.containsKey(ERRORS.CONFUSING_CREDENTIALS.toString()))
+ username_field.setError("Perhaps you used your non LEAP credentials");
if (arguments.containsKey(USERNAME)) {
String username = arguments.getString(USERNAME);
username_field.setText(username);
}
- if (arguments.containsKey(USERNAME_MISSING)) {
+ if (arguments.containsKey(ERRORS.USERNAME_MISSING.toString())) {
username_field.setError(getString(R.string.username_ask));
}
if(arguments.containsKey(getString(R.string.user_message)))