Clear repeat password field when unequal passwords are entered

This commit is contained in:
Kai S. K. Engelbart 2020-06-25 10:21:27 +02:00
parent 8291223532
commit 3ce9c03f8b

View File

@ -114,8 +114,10 @@ public final class LoginScene {
private void loginButtonPressed() {
// Prevent registration with unequal passwords
if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText()))
if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText())) {
new Alert(AlertType.ERROR, "The entered password is unequal to the repeated one").showAndWait();
repeatPasswordField.clear();
}
else performHandshake(
new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), registerCheckBox.isSelected(), Startup.VERSION));
}