Sometimes I'm really dumb and duplicate a line of code

This commit is contained in:
NovaFox161
2020-03-11 18:21:19 -05:00
parent 0941d19a87
commit 33d5169bbb
2 changed files with 6 additions and 4 deletions
@@ -181,7 +181,6 @@ public class WebGuild {
else
data.put("settings", settings.toJson());
data.put("settings", settings.toJson());
if (botNick != null && !botNick.equals(""))
data.put("bot_nick", botNick);
data.put("manage_server", manageServer);
@@ -46,12 +46,14 @@ public class Authentication {
.setStatus(200)
.setReason("Success")
.setKeyUsed(key)
.setFromDisCalNetwork(false)
.setIsReadOnly(false);
} else if (readOnlyKeys.containsKey(key)) {
return new AuthenticationState(true)
.setStatus(200)
.setReason("Success")
.setKeyUsed(key)
.setFromDisCalNetwork(false)
.setIsReadOnly(true);
} else if (key.equals("teapot")) {
return new AuthenticationState(false)
@@ -69,13 +71,14 @@ public class Authentication {
return new AuthenticationState(true)
.setStatus(200)
.setReason("Success")
.setKeyUsed(key);
.setKeyUsed(key)
.setFromDisCalNetwork(false);
}
//If we reach here, the API key does not exist or is blocked...
return new AuthenticationState(false)
.setStatus(405)
.setReason("Method not allowed");
.setStatus(401)
.setReason("Authorization Denied");
} else {
Logger.getLogger().api("Attempted to use API without authorization header", request.getRemoteAddr());
return new AuthenticationState(false)