diff --git a/client/src/main/java/envoy/client/ui/controller/LoginScene.java b/client/src/main/java/envoy/client/ui/controller/LoginScene.java
index 71e3988..285f3de 100644
--- a/client/src/main/java/envoy/client/ui/controller/LoginScene.java
+++ b/client/src/main/java/envoy/client/ui/controller/LoginScene.java
@@ -46,6 +46,9 @@ public final class LoginScene implements EventListener {
@FXML
private Button loginButton;
+ @FXML
+ private CheckBox cbStaySignedIn;
+
@FXML
private Button offlineModeButton;
@@ -55,7 +58,7 @@ public final class LoginScene implements EventListener {
@FXML
private ImageView logo;
- private boolean registration = false;
+ private boolean registration;
private static final Logger logger = EnvoyLog.getLogger(LoginScene.class);
private static final ClientConfig config = ClientConfig.getInstance();
@@ -76,6 +79,7 @@ public final class LoginScene implements EventListener {
@FXML
private void loginButtonPressed() {
final String user = userTextField.getText(), pass = passwordField.getText(), repeatPass = repeatPasswordField.getText();
+ final boolean requestToken = cbStaySignedIn.isSelected();
// Prevent registration with unequal passwords
if (registration && !pass.equals(repeatPass)) {
@@ -86,8 +90,8 @@ public final class LoginScene implements EventListener {
userTextField.clear();
} else {
Instant lastSync = Startup.loadLastSync(userTextField.getText());
- Startup.performHandshake(registration ? LoginCredentials.registration(user, pass, Startup.VERSION, lastSync)
- : LoginCredentials.login(user, pass, Startup.VERSION, lastSync));
+ Startup.performHandshake(registration ? LoginCredentials.registration(user, pass, requestToken, Startup.VERSION, lastSync)
+ : LoginCredentials.login(user, pass, requestToken, Startup.VERSION, lastSync));
}
}
diff --git a/client/src/main/resources/fxml/LoginScene.fxml b/client/src/main/resources/fxml/LoginScene.fxml
index 1ade0f8..e1316c4 100644
--- a/client/src/main/resources/fxml/LoginScene.fxml
+++ b/client/src/main/resources/fxml/LoginScene.fxml
@@ -2,6 +2,7 @@
+
@@ -32,9 +33,7 @@
-