From 3c4b1a254392a6443b96a883cc8df45d57e529b7 Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 16 Jul 2019 04:08:25 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=20authType=20-=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socket/response/auth/AuthResponse.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 9112a9e2..1e1a2594 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 @@ -50,7 +50,7 @@ public AuthResponse(String login, String password, String auth_id, OshiHWID hwid public HWID hwid; public enum ConnectTypes { - SERVER, CLIENT, BOT + SERVER, CLIENT, BOT, API } @Override @@ -128,7 +128,7 @@ public void execute(ChannelHandlerContext ctx, Client clientData) throws Excepti if (!clientData.permissions.canProxy) throw new AuthException("initProxy not allow"); clientData.proxy = true; } - if (server.config.protectHandler.allowGetAccessToken(context)) { + if (authType != ConnectTypes.API && server.config.protectHandler.allowGetAccessToken(context)) { UUID uuid = pair.handler.auth(aresult); result.playerProfile = ProfileByUUIDResponse.getProfile(uuid, aresult.username, client, clientData.auth.textureProvider); LogHelper.debug("Auth: %s accessToken %s uuid: %s", login, result.accessToken, uuid.toString()); @@ -140,10 +140,10 @@ public void execute(ChannelHandlerContext ctx, Client clientData) throws Excepti } public static class AuthContext { - public AuthContext(long session, String login, int password_lenght, String customText, String client, String hwid, String ip, ConnectTypes authType) { + public AuthContext(long session, String login, int password_length, String customText, String client, String hwid, String ip, ConnectTypes authType) { this.session = session; this.login = login; - this.password_lenght = password_lenght; + this.password_length = password_length; this.customText = customText; this.client = client; this.hwid = hwid; @@ -153,7 +153,7 @@ public AuthContext(long session, String login, int password_lenght, String custo public long session; public String login; - public int password_lenght; //Use AuthProvider for get password + public int password_length; //Use AuthProvider for get password public String client; public String hwid; public String customText;