From e7fd749c2fe9ee9975bf3eeca6cd31667af0915e Mon Sep 17 00:00:00 2001 From: Gravit Date: Sun, 7 Jun 2020 12:52:36 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9E=D0=B1=D1=80=D0=B0=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=20AuthHandler'=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socket/response/auth/AuthResponse.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java index 8cf4f0f2..ae85d459 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java @@ -98,14 +98,20 @@ public void execute(ChannelHandlerContext ctx, Client clientData) throws Excepti } result.session = clientData.session; } - UUID uuid = pair.handler.auth(aresult); - result.playerProfile = ProfileByUUIDResponse.getProfile(uuid, aresult.username, client, clientData.auth.textureProvider); - if (authType == ConnectTypes.API || !server.config.protectHandler.allowGetAccessToken(context)) { + UUID uuid; + if (authType == ConnectTypes.CLIENT && server.config.protectHandler.allowGetAccessToken(context)) { + uuid = pair.handler.auth(aresult); + if (LogHelper.isDebugEnabled()) { + LogHelper.debug("Auth: %s accessToken %s uuid: %s", login, result.accessToken, uuid.toString()); + } + } + else + { + uuid = pair.handler.usernameToUUID(aresult.username); result.accessToken = null; } - else if (LogHelper.isDebugEnabled()) { - LogHelper.debug("Auth: %s accessToken %s uuid: %s", login, result.accessToken, uuid.toString()); - } + result.playerProfile = ProfileByUUIDResponse.getProfile(uuid, aresult.username, client, clientData.auth.textureProvider); + clientData.type = authType; sendResult(result); } catch (AuthException | HookException e) {