From 320283639262b06d72ddd9d6d9cef2e6ac1b0fe4 Mon Sep 17 00:00:00 2001 From: mdxd44 Date: Fri, 20 May 2022 03:24:26 +0900 Subject: Fix. --- .../java/net/elytrium/limboauth/handler/AuthSessionHandler.java | 9 +++++++-- 1 file 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 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 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)); -- cgit