mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-21 20:21:27 +00:00
Enforce minimum password length (amendment to #1018)
This commit is contained in:
@@ -50,7 +50,7 @@ public class NewPasswordController implements FxController {
|
||||
}
|
||||
|
||||
private void passwordsDidChange(@SuppressWarnings("unused") Observable observable) {
|
||||
if (hasSamePasswordInBothFields()) {
|
||||
if (hasSamePasswordInBothFields() && strengthRater.fulfillsMinimumRequirements(passwordField.getCharacters())) {
|
||||
password.set(passwordField.getCharacters());
|
||||
} else {
|
||||
password.set("");
|
||||
|
||||
@@ -34,6 +34,10 @@ public class PasswordStrengthUtil {
|
||||
this.zxcvbn = new Zxcvbn();
|
||||
}
|
||||
|
||||
public boolean fulfillsMinimumRequirements(CharSequence password) {
|
||||
return password.length() >= minPwLength;
|
||||
}
|
||||
|
||||
public int computeRate(CharSequence password) {
|
||||
if (password == null || password.length() < minPwLength) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user