From 4e9702a69141511c6e6a0f59343cb7cb88636737 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Thu, 25 Jun 2020 10:21:27 +0200 Subject: [PATCH] Clear repeat password field when unequal passwords are entered --- src/main/java/envoy/client/ui/controller/LoginScene.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/envoy/client/ui/controller/LoginScene.java b/src/main/java/envoy/client/ui/controller/LoginScene.java index 2435980..a72ef78 100644 --- a/src/main/java/envoy/client/ui/controller/LoginScene.java +++ b/src/main/java/envoy/client/ui/controller/LoginScene.java @@ -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)); }