aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
index 75fd862..29c540c 100644
--- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
+++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
@@ -82,6 +82,7 @@ public class AuthSessionHandler implements LimboSessionHandler {
private static Component loginSuccessful;
@Nullable
private static Title loginSuccessfulTitle;
+ @Nullable
private static MigrationHash migrationHash;
private final Dao<RegisteredPlayer, String> playerDao;
@@ -408,7 +409,11 @@ public class AuthSessionHandler implements LimboSessionHandler {
Settings.IMP.MAIN.CRACKED_TITLE_SETTINGS.toTimes()
);
}
- migrationHash = MigrationHash.valueOf(Settings.IMP.MAIN.MIGRATION_HASH);
+ if (Settings.IMP.MAIN.MIGRATION_HASH.isEmpty()) {
+ migrationHash = null;
+ } else {
+ migrationHash = MigrationHash.valueOf(Settings.IMP.MAIN.MIGRATION_HASH);
+ }
}
public static boolean checkPassword(String password, RegisteredPlayer player, Dao<RegisteredPlayer, String> playerDao) {
@@ -418,7 +423,7 @@ public class AuthSessionHandler implements LimboSessionHandler {
hash.replace("BCRYPT$", "$2a$").getBytes(StandardCharsets.UTF_8)
).verified;
- if (!isCorrect && !Settings.IMP.MAIN.MIGRATION_HASH.isEmpty()) {
+ if (!isCorrect && migrationHash != null) {
isCorrect = migrationHash.checkPassword(hash, password);
if (isCorrect) {
player.setHash(genHash(password));