Added GuiRegister to allow users to create a new account on ReplayMod.com from the Mod itself
This commit is contained in:
@@ -29,6 +29,15 @@ public class ApiClient {
|
||||
return auth;
|
||||
}
|
||||
|
||||
public AuthKey register(String username, String mail, String password) throws IOException, ApiException {
|
||||
QueryBuilder builder = new QueryBuilder(ApiMethods.register);
|
||||
builder.put("username", username);
|
||||
builder.put("email", mail);
|
||||
builder.put("password", password);
|
||||
AuthKey auth = invokeAndReturn(builder, AuthKey.class);
|
||||
return auth;
|
||||
}
|
||||
|
||||
public boolean logout(String auth) throws IOException, ApiException {
|
||||
QueryBuilder builder = new QueryBuilder(ApiMethods.logout);
|
||||
builder.put("auth", auth);
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.crushedpixel.replaymod.api.client;
|
||||
|
||||
public class ApiMethods {
|
||||
|
||||
public static final String register = "register";
|
||||
public static final String login = "login";
|
||||
public static final String logout = "logout";
|
||||
public static final String replay_files = "replay_files";
|
||||
|
||||
Reference in New Issue
Block a user