From 8a8ca87c8d795f4d6a3ccbd0ec04add2f0fe70d7 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sat, 12 Nov 2016 18:13:28 +1100 Subject: [PATCH] spjspj - Make test mode of server not care about password --- Mage.Server/src/main/java/mage/server/Session.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index 23c8080471..9baa696027 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -185,9 +185,15 @@ public class Session { AuthorizedUser authorizedUser = null; if (ConfigSettings.getInstance().isAuthenticationActivated()) { authorizedUser = AuthorizedUserRepository.instance.getByName(userName); - if (authorizedUser == null || !authorizedUser.doCredentialsMatch(userName, password)) { - return "Wrong username or password. In case you haven't, please register your account first."; + String errorMsg = "Wrong username or password. In case you haven't, please register your account first."; + if (authorizedUser == null) { + return errorMsg; } + + if (!Main.isTestMode() && !authorizedUser.doCredentialsMatch(userName, password)) { + return errorMsg; + } + if (!authorizedUser.active) { return "Your profile is deactivated, you can't sign on."; }