[FIX] Bad Login (Clientside) in MySQLAuthCoreProvider

This commit is contained in:
Gravit 2021-06-20 12:01:39 +07:00
parent 867f367860
commit e36cfea4f9
No known key found for this signature in database
GPG key ID: 98A079490768CCE5

View file

@ -166,6 +166,8 @@ public void init(LaunchServer server) {
protected boolean updateAuth(User user, String accessToken) throws IOException { protected boolean updateAuth(User user, String accessToken) throws IOException {
try (Connection c = mySQLHolder.getConnection()) { try (Connection c = mySQLHolder.getConnection()) {
MySQLUser mySQLUser = (MySQLUser) user;
mySQLUser.accessToken = accessToken;
PreparedStatement s = c.prepareStatement(updateAuthSQL); PreparedStatement s = c.prepareStatement(updateAuthSQL);
s.setString(1, accessToken); s.setString(1, accessToken);
s.setString(2, user.getUUID().toString()); s.setString(2, user.getUUID().toString());
@ -179,6 +181,8 @@ protected boolean updateAuth(User user, String accessToken) throws IOException {
@Override @Override
protected boolean updateServerID(User user, String serverID) throws IOException { protected boolean updateServerID(User user, String serverID) throws IOException {
try (Connection c = mySQLHolder.getConnection()) { try (Connection c = mySQLHolder.getConnection()) {
MySQLUser mySQLUser = (MySQLUser) user;
mySQLUser.serverId = serverID;
PreparedStatement s = c.prepareStatement(updateServerIDSQL); PreparedStatement s = c.prepareStatement(updateServerIDSQL);
s.setString(1, serverID); s.setString(1, serverID);
s.setString(2, user.getUUID().toString()); s.setString(2, user.getUUID().toString());