Adapted authkey check to new website return values and prepared for future username display

This commit is contained in:
CrushedPixel
2015-05-15 02:38:06 +02:00
parent bf03e2e05b
commit 38b900a33b
4 changed files with 30 additions and 13 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}