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) {