Added GuiRegister to allow users to create a new account on ReplayMod.com from the Mod itself
This commit is contained in:
@@ -3,6 +3,7 @@ package eu.crushedpixel.replaymod.online.authentication;
|
||||
import eu.crushedpixel.replaymod.ReplayMod;
|
||||
import eu.crushedpixel.replaymod.api.client.ApiClient;
|
||||
import eu.crushedpixel.replaymod.api.client.ApiException;
|
||||
import eu.crushedpixel.replaymod.api.client.holders.AuthKey;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -28,6 +29,12 @@ public class AuthenticationHandler {
|
||||
return apiClient.hasDonated(uuid);
|
||||
}
|
||||
|
||||
public static void register(String username, String mail, String password) throws IOException, ApiException {
|
||||
AuthKey auth = apiClient.register(username, mail, password);
|
||||
authkey = auth.getAuthkey();
|
||||
}
|
||||
|
||||
|
||||
public static int authenticate(String username, String password) {
|
||||
try {
|
||||
authkey = ReplayMod.apiClient.getLogin(username, password).getAuthkey();
|
||||
|
||||
Reference in New Issue
Block a user