Skip to content

Commit

Permalink
Fix Login Errors
Browse files Browse the repository at this point in the history
* Show more meaningful error when a LoginException occurs
* Handle the LoginPacket on error so a disconnect can be processed

Closes #5
  • Loading branch information
bundabrg committed Sep 3, 2020
1 parent 1489543 commit fdcb80c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ public boolean handle(LoginPacket loginPacket) {
packet.setJwt(serverSession.getLoginData().getHandshakeJwt().serialize());
session.sendUpstreamPacketImmediately(packet);
} catch (LoginException e) {
session.disconnect("disconnectionScreen.internalError.cantConnect");
session.getConnector().getLogger().error("Failed to encrypt connection", e);
session.disconnect("You are not able to connect. Please make sure your account is authorized to connect or contact the server administrator.");
session.getConnector().getLogger().error("Failed to encrypt connection: " + e.getMessage());
return true;
}

// Setup Session
Expand Down

0 comments on commit fdcb80c

Please sign in to comment.