Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password can be made stronger #966

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions org.envirocar.app/res/values/strings_activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<string name="register_progress_signing_in">Registering&#8230;</string>
<string name="error_passwords_not_matching">The passwords do not match.</string>
<string name="error_invalid_username">This username is too short.</string>
<string name="error_username_contain_special">Special symbol not allowed except underscore</string>
<string name="error_field_weak_password">Password must contain at least one uppercase letter, one lowercase letter and one digit</string>
<string name="error_username_contain_special">Please enter a valid username of length greater than 6 and the special symbol is not allowed except underscore</string>
<string name="error_field_weak_password">The Password should be of length 8–20 characters, and it must contain at least one uppercase letter, one lowercase letter, one digit, and one special character.</string>

<string name="error_username_already_in_use">This username is already in use.</string>
<string name="error_email_already_in_use">This email is already in use.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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+$).{8,20}$";
private static final String USERNAME_REGEX = "^[A-Za-z0-9_-]{6,}$";
private static final int CHECK_FORM_DELAY = 750;
private static Drawable errorPassword;
Expand Down Expand Up @@ -400,7 +400,7 @@ private boolean checkPasswordValidity(String password) {
if (password == null || password.isEmpty() || password.equals("")) {
password1EditText.setError(getString(R.string.error_field_required), errorPassword);
isValidPassword = false;
} else if (password.length() < 6) {
} else if (password.length() < 8) {
password1EditText.setError(getString(R.string.error_invalid_password), errorPassword);
isValidPassword = false;
} else if (!Pattern.matches(PASSWORD_REGEX, password)) {
Expand Down