From 9fff11e8872d7e8fa38f9185e0580e4389be098d Mon Sep 17 00:00:00 2001 From: Gravit'a Date: Sun, 8 Aug 2021 14:53:25 +0700 Subject: [PATCH] [FIX] JsonCoreProvider verifyPassword --- .../launchserver/auth/core/JsonCoreProvider.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/JsonCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/JsonCoreProvider.java index 02cd2b72..25642b44 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/JsonCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/JsonCoreProvider.java @@ -132,16 +132,16 @@ public void verifyAuth(AuthResponse.AuthContext context) throws AuthException { public PasswordVerifyReport verifyPassword(User user, AuthRequest.AuthPasswordInterface password) { JsonUser jsonUser = (JsonUser) user; if (password instanceof AuthPlainPassword && jsonUser.password != null && passwordVerifier != null) { - if (passwordVerifier.check(((AuthPlainPassword) password).password, jsonUser.password)) { + if (passwordVerifier.check(jsonUser.password, ((AuthPlainPassword) password).password)) { return PasswordVerifyReport.OK; } else { return PasswordVerifyReport.FAILED; } } if (user == null) { - return jsonRequest(new JsonPasswordVerify(null, null), verifyPasswordUrl, PasswordVerifyReport.class); + return jsonRequest(new JsonPasswordVerify(null, null, password), verifyPasswordUrl, PasswordVerifyReport.class); } - return jsonRequest(new JsonPasswordVerify(user.getUsername(), user.getUUID()), verifyPasswordUrl, PasswordVerifyReport.class); + return jsonRequest(new JsonPasswordVerify(user.getUsername(), user.getUUID(), password), verifyPasswordUrl, PasswordVerifyReport.class); } @Override @@ -225,10 +225,12 @@ public AuthManager.AuthReport toAuthReport() { public static class JsonPasswordVerify { public String username; public UUID uuid; + public AuthRequest.AuthPasswordInterface password; - public JsonPasswordVerify(String username, UUID uuid) { + public JsonPasswordVerify(String username, UUID uuid, AuthRequest.AuthPasswordInterface password) { this.username = username; this.uuid = uuid; + this.password = password; } }