diff options
author | mdxd44 <ogurec332@mail.ru> | 2022-05-20 03:24:26 +0900 |
---|---|---|
committer | mdxd44 <ogurec332@mail.ru> | 2022-05-20 03:24:26 +0900 |
commit | 320283639262b06d72ddd9d6d9cef2e6ac1b0fe4 (patch) | |
tree | 97edb23abae2244e76951580689d53b97f4f0edd | |
parent | 903fd1e1d86cdd70eddf300e3370cad0cd7d538b (diff) | |
download | LimboAuth-320283639262b06d72ddd9d6d9cef2e6ac1b0fe4.tar.gz LimboAuth-320283639262b06d72ddd9d6d9cef2e6ac1b0fe4.tar.bz2 LimboAuth-320283639262b06d72ddd9d6d9cef2e6ac1b0fe4.zip |
Fix.
-rw-r--r-- | src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java | 9 |
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)); |