From 8c8170931786e148a6c6a417b1399bf803701bd2 Mon Sep 17 00:00:00 2001
From: pree-T <47977131+pree-T@users.noreply.github.com>
Date: Thu, 13 Jan 2022 15:28:07 +0530
Subject: [PATCH 1/2] Password authentication made stronger.Error password and
username message is now more informative.
---
org.envirocar.app/res/values/strings_activity_login.xml | 6 +++---
.../src/org/envirocar/app/views/login/SignupActivity.java | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/org.envirocar.app/res/values/strings_activity_login.xml b/org.envirocar.app/res/values/strings_activity_login.xml
index 2728abc7a..17b793f88 100644
--- a/org.envirocar.app/res/values/strings_activity_login.xml
+++ b/org.envirocar.app/res/values/strings_activity_login.xml
@@ -22,16 +22,16 @@
Register
Sign in
This email address is invalid.
- This password is too short.
+ This password is too short.Password must be of atleast 6 characters.
This password is incorrect.
Username or password is incorrect
This field is required.
Not connected to network
Registering…
The passwords do not match.
- This username is too short.
+ This username is too short.Username must be of atleast 6 characters.
Special symbol not allowed except underscore
- Password must contain at least one uppercase letter, one lowercase letter and one digit
+ Password must contain at least one uppercase letter, one lowercase letter , one digit and one special character
This username is already in use.
This email is already in use.
diff --git a/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java b/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java
index 8c6afff00..2617b8b17 100644
--- a/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java
+++ b/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java
@@ -81,7 +81,7 @@ public class SignupActivity extends BaseInjectorActivity {
private static final Logger LOG = Logger.getLogger(SignupActivity.class);
private static final String EMAIL_REGEX = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$";
- private static final String PASSWORD_REGEX = "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{6,}$";
+ private static final String PASSWORD_REGEX = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\\S+$).{6,}$";
private static final String USERNAME_REGEX = "^[A-Za-z0-9_-]{6,}$";
private static final int CHECK_FORM_DELAY = 750;
private static Drawable errorPassword;
From 9592c241555d99c672f1ce60ca93bcc752d6e9db Mon Sep 17 00:00:00 2001
From: pree-T <47977131+pree-T@users.noreply.github.com>
Date: Sun, 30 Jan 2022 20:23:30 +0530
Subject: [PATCH 2/2] requested changes made.
---
org.envirocar.app/res/values/strings_activity_login.xml | 4 ++--
.../src/org/envirocar/app/views/login/SignupActivity.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/org.envirocar.app/res/values/strings_activity_login.xml b/org.envirocar.app/res/values/strings_activity_login.xml
index 17b793f88..c2c62325d 100644
--- a/org.envirocar.app/res/values/strings_activity_login.xml
+++ b/org.envirocar.app/res/values/strings_activity_login.xml
@@ -29,9 +29,9 @@
Not connected to network
Registering…
The passwords do not match.
- This username is too short.Username must be of atleast 6 characters.
+ This username is too short. Username must be of atleast 6 characters.
Special symbol not allowed except underscore
- Password must contain at least one uppercase letter, one lowercase letter , one digit and one special character
+ Password must contain at least one uppercase letter, one lowercase letter and one digit
This username is already in use.
This email is already in use.
diff --git a/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java b/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java
index 2617b8b17..8c6afff00 100644
--- a/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java
+++ b/org.envirocar.app/src/org/envirocar/app/views/login/SignupActivity.java
@@ -81,7 +81,7 @@ public class SignupActivity extends BaseInjectorActivity {
private static final Logger LOG = Logger.getLogger(SignupActivity.class);
private static final String EMAIL_REGEX = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$";
- private static final String PASSWORD_REGEX = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\\S+$).{6,}$";
+ private static final String PASSWORD_REGEX = "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{6,}$";
private static final String USERNAME_REGEX = "^[A-Za-z0-9_-]{6,}$";
private static final int CHECK_FORM_DELAY = 750;
private static Drawable errorPassword;