mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
bug6104: adding zxcvbn-1.9.0 to target platform
This commit is contained in:
@@ -1079,7 +1079,7 @@ implements ReplicableSecurityService, ClearStateTestSupport {
|
||||
}
|
||||
if (username == null || username.length() < 3) {
|
||||
throw new UserManagementException(UserManagementException.USERNAME_DOES_NOT_MEET_REQUIREMENTS);
|
||||
} else if (password == null || password.length() < 5) {
|
||||
} else if (isPasswordGoodEnough(password)) {
|
||||
throw new UserManagementException(UserManagementException.PASSWORD_DOES_NOT_MEET_REQUIREMENTS);
|
||||
}
|
||||
RandomNumberGenerator rng = new SecureRandomNumberGenerator();
|
||||
@@ -1098,6 +1098,10 @@ implements ReplicableSecurityService, ClearStateTestSupport {
|
||||
updateSimpleUserEmail(username, email, validationBaseURL);
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean isPasswordGoodEnough(String password) {
|
||||
return password == null || password.length() < 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the {@code clientIP} is currently blocked for user creation, and if so, throws a
|
||||
@@ -1183,7 +1187,7 @@ implements ReplicableSecurityService, ClearStateTestSupport {
|
||||
}
|
||||
|
||||
private void updateSimpleUserPassword(final User user, String newPassword) throws UserManagementException {
|
||||
if (newPassword == null || newPassword.length() < 5) {
|
||||
if (isPasswordGoodEnough(newPassword)) {
|
||||
throw new UserManagementException(UserManagementException.PASSWORD_DOES_NOT_MEET_REQUIREMENTS);
|
||||
}
|
||||
// for non-admins, check that the old password is correct
|
||||
|
||||
Reference in New Issue
Block a user