From 3ce9c03f8b77acd02b619ba3971e835ea92e81f0 Mon Sep 17 00:00:00 2001 From: kske 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)); }