[FIX] Обращение к AuthHandler'у

This commit is contained in:
Gravit 2020-06-07 12:52:36 +07:00
parent eca8cc2cbc
commit e7fd749c2f
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -98,14 +98,20 @@ public void execute(ChannelHandlerContext ctx, Client clientData) throws Excepti
} }
result.session = clientData.session; result.session = clientData.session;
} }
UUID uuid = pair.handler.auth(aresult); UUID uuid;
result.playerProfile = ProfileByUUIDResponse.getProfile(uuid, aresult.username, client, clientData.auth.textureProvider); if (authType == ConnectTypes.CLIENT && server.config.protectHandler.allowGetAccessToken(context)) {
if (authType == ConnectTypes.API || !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; result.accessToken = null;
} }
else if (LogHelper.isDebugEnabled()) { result.playerProfile = ProfileByUUIDResponse.getProfile(uuid, aresult.username, client, clientData.auth.textureProvider);
LogHelper.debug("Auth: %s accessToken %s uuid: %s", login, result.accessToken, uuid.toString());
}
clientData.type = authType; clientData.type = authType;
sendResult(result); sendResult(result);
} catch (AuthException | HookException e) { } catch (AuthException | HookException e) {