[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;
}
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) {