mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] HttpAuthCoreProvider findmulti
This commit is contained in:
parent
31b6ae35e7
commit
a0722fb5f4
2 changed files with 9 additions and 2 deletions
|
@ -59,6 +59,7 @@ public <T> HttpHelper.HttpOptional<T, SimpleError> send(HttpRequest request, Cla
|
|||
return HttpHelper.send(httpClient, request, makeEH(clazz));
|
||||
}
|
||||
|
||||
|
||||
public static class SimpleErrorHandler<T> implements HttpHelper.HttpJsonErrorHandler<T, SimpleError> {
|
||||
private final Type type;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package pro.gravit.launchserver.auth.core;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
|
@ -232,14 +233,15 @@ public void addPublicKeyToHardwareInfo(UserHardware hardware, byte[] publicKey)
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public Iterable<User> getUsersByHardwareInfo(UserHardware hardware) {
|
||||
if (getUsersByHardwareInfoUrl == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return requester.send(requester
|
||||
.post(getUsersByHardwareInfoUrl, new HardwareRequest((HttpUserHardware) hardware), bearerToken), List.class).getOrThrow();
|
||||
return (List<User>) (List) requester.send(requester
|
||||
.post(getUsersByHardwareInfoUrl, new HardwareRequest((HttpUserHardware) hardware), bearerToken), GetHardwareListResponse.class).getOrThrow().list;
|
||||
} catch (IOException e) {
|
||||
logger.error(e);
|
||||
return null;
|
||||
|
@ -354,6 +356,10 @@ public static class GetAuthDetailsResponse {
|
|||
public List<GetAvailabilityAuthRequestEvent.AuthAvailabilityDetails> details;
|
||||
}
|
||||
|
||||
public static class GetHardwareListResponse {
|
||||
public List<HttpUser> list;
|
||||
}
|
||||
|
||||
public static class JoinServerRequest {
|
||||
public String username;
|
||||
public String accessToken;
|
||||
|
|
Loading…
Reference in a new issue