From 89b9afb3dbcede1b101928e1b2d34cffe2a915e3 Mon Sep 17 00:00:00 2001 From: kske Date: Fri, 18 Sep 2020 10:01:57 +0200 Subject: [PATCH] Remove config based autologin Fixes #27 --- .../java/envoy/client/data/ClientConfig.java | 26 ------------------- .../main/java/envoy/client/ui/Startup.java | 8 +++--- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/client/src/main/java/envoy/client/data/ClientConfig.java b/client/src/main/java/envoy/client/data/ClientConfig.java index a7763e0..1d6498e 100644 --- a/client/src/main/java/envoy/client/data/ClientConfig.java +++ b/client/src/main/java/envoy/client/data/ClientConfig.java @@ -35,8 +35,6 @@ public final class ClientConfig extends Config { put("server", "s", identity()); put("port", "p", Integer::parseInt); put("localDB", "db", File::new); - put("user", "u", identity()); - put("password", "pw", identity()); } /** @@ -56,28 +54,4 @@ public final class ClientConfig extends Config { * @since Envoy Client v0.1-alpha */ public File getLocalDB() { return (File) items.get("localDB").get(); } - - /** - * @return the user name - * @since Envoy Client v0.3-alpha - */ - public String getUser() { - final String user = (String) items.get("user").get(); - return user.equals("") ? null : user; - } - - /** - * @return the password - * @since Envoy Client v0.3-alpha - */ - public String getPassword() { - final String password = (String) items.get("password").get(); - return password.equals("") ? null : password; - } - - /** - * @return {@code true} if user name and password are set - * @since Envoy Client v0.3-alpha - */ - public boolean hasLoginCredentials() { return getUser() != null && getPassword() != null; } } diff --git a/client/src/main/java/envoy/client/ui/Startup.java b/client/src/main/java/envoy/client/ui/Startup.java index 30757c5..a9103c9 100644 --- a/client/src/main/java/envoy/client/ui/Startup.java +++ b/client/src/main/java/envoy/client/ui/Startup.java @@ -79,16 +79,16 @@ public final class Startup extends Application { localDB.loadIDGenerator(); context.setLocalDB(localDB); + // Configure stage stage.setTitle("Envoy"); stage.getIcons().add(IconUtil.loadIcon("envoy_logo")); + // Create scene context final var sceneContext = new SceneContext(stage); context.setSceneContext(sceneContext); - // Perform automatic login if configured - if (config.hasLoginCredentials()) - performHandshake(new LoginCredentials(config.getUser(), config.getPassword(), false, Startup.VERSION, loadLastSync(config.getUser()))); - else sceneContext.load(SceneInfo.LOGIN_SCENE); + // Load login scene + sceneContext.load(SceneInfo.LOGIN_SCENE); } /**