Server now responds with 401 when incorrect login (instead of 403)

This commit is contained in:
Carlos
2019-08-12 14:18:44 +02:00
parent 31686615f3
commit c691c2de0b
5 changed files with 239 additions and 39 deletions

View File

@ -3,7 +3,7 @@ package com.mesacarlos.webconsole.command;
import org.bukkit.Bukkit;
import org.java_websocket.WebSocket;
import com.mesacarlos.webconsole.json.Forbidden;
import com.mesacarlos.webconsole.json.LoginRequired;
import com.mesacarlos.webconsole.json.Processed;
import com.mesacarlos.webconsole.util.LoginManager;
import com.mesacarlos.webconsole.websockets.WSServer;
@ -25,7 +25,7 @@ public class LogInCommand implements WSCommand {
wsServer.sendToClient(conn, new Processed("Logged In", "LOGIN ********"));
Bukkit.getLogger().info("[WebConsole] Successfully logged in from " + conn.getRemoteSocketAddress());
} else {
wsServer.sendToClient(conn, new Forbidden("Forbidden","LOGIN ********"));
wsServer.sendToClient(conn, new LoginRequired("Incorrect password, try again"));
Bukkit.getLogger()
.info("[WebConsole] Password incorrect while login from " + conn.getRemoteSocketAddress());
}