Adapted authkey check to new website return values and prepared for future username display
This commit is contained in:
@@ -39,14 +39,14 @@ public class ApiClient {
|
||||
return auth;
|
||||
}
|
||||
|
||||
public boolean checkAuthkey(String auth) {
|
||||
public AuthConfirmation checkAuthkey(String auth) {
|
||||
try {
|
||||
QueryBuilder builder = new QueryBuilder(ApiMethods.check_authkey);
|
||||
builder.put("auth", auth);
|
||||
Success succ = invokeAndReturn(builder, Success.class);
|
||||
return succ.isSuccess();
|
||||
AuthConfirmation conf = invokeAndReturn(builder, AuthConfirmation.class);
|
||||
return conf;
|
||||
} catch(Exception e) {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package eu.crushedpixel.replaymod.api.client.holders;
|
||||
|
||||
public class AuthConfirmation {
|
||||
private String username;
|
||||
private int id;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user