Merge pull request #2586 from spjspj/master

spjspj - Make test mode of server not care about password
This commit is contained in:
spjspj 2016-11-12 19:06:05 +11:00 committed by GitHub
commit f0aad053aa

View file

@ -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.";
}