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 authentication made stronger. Error messages more informative #882

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions org.envirocar.app/res/values/strings_activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
<string name="action_sign_in_register">Register</string>
<string name="action_sign_in_short">Sign in</string>
<string name="error_invalid_email">This email address is invalid.</string>
<string name="error_invalid_password">This password is too short.</string>
<string name="error_invalid_password">This password is too short.Password must be of atleast 6 characters.</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space after full-stop.

<string name="error_incorrect_password">This password is incorrect.</string>
<string name="error_invalid_credentials">Username or password is incorrect</string>
<string name="error_field_required">This field is required.</string>
<string name="error_not_connected_to_network">Not connected to network</string>
<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_invalid_username">This username is too short.Username must be of atleast 6 characters.</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is a good enhancement. Kindly remove the extra space between letters and add space after fullstop.

<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_field_weak_password">Password must contain at least one uppercase letter, one lowercase letter , one digit and one special character</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change.


<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+$).{6,}$";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation is sufficent as of now. Also to implement this enhancement first the changes should be made on server so that the app gets supported with the new changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I revert this change?

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