aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Ilin <hevav@hevav.dev>2022-04-03 23:00:29 +0300
committerPetr Ilin <hevav@hevav.dev>2022-04-03 23:00:29 +0300
commit756c1107de7babeb37583b74b55e431f13dc0f45 (patch)
tree0f32464bb392f6bcff6084009638df9bc0ed0ba6
parentb86b1ec801bca9eaf75be8eafe043062cbf9c7a0 (diff)
downloadLimboAuth-756c1107de7babeb37583b74b55e431f13dc0f45.tar.gz
LimboAuth-756c1107de7babeb37583b74b55e431f13dc0f45.tar.bz2
LimboAuth-756c1107de7babeb37583b74b55e431f13dc0f45.zip
Session fix x2
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index bdde110..329fcb7 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -372,11 +372,12 @@ public class LimboAuth {
}
public boolean needAuth(Player player) {
- String username = player.getUsername().toLowerCase(Locale.ROOT);
- if (!this.cachedAuthChecks.containsKey(username)) {
+ String username = player.getUsername();
+ String lowercaseUsername = username.toLowerCase(Locale.ROOT);
+ if (!this.cachedAuthChecks.containsKey(lowercaseUsername)) {
return true;
} else {
- CachedSessionUser sessionUser = this.cachedAuthChecks.get(username);
+ CachedSessionUser sessionUser = this.cachedAuthChecks.get(lowercaseUsername);
return !sessionUser.getInetAddress().equals(player.getRemoteAddress().getAddress()) || !sessionUser.getUsername().equals(username);
}
}