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 cde91a77ef
commit 4e9702a691

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));
}