mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-27 12:45:57 +01:00
Skip IP check for API registration
This commit is contained in:
parent
f752b9d7a7
commit
ee41d92216
@ -49,7 +49,7 @@ public class AsyncRegister implements AsynchronousProcess {
|
|||||||
* @param <P> parameters type
|
* @param <P> parameters type
|
||||||
*/
|
*/
|
||||||
public <P extends RegistrationParameters> void register(RegistrationMethod<P> variant, P parameters) {
|
public <P extends RegistrationParameters> void register(RegistrationMethod<P> variant, P parameters) {
|
||||||
if (preRegisterCheck(parameters.getPlayer())) {
|
if (preRegisterCheck(variant, parameters.getPlayer())) {
|
||||||
RegistrationExecutor<P> executor = registrationExecutorFactory.getSingleton(variant.getExecutorClass());
|
RegistrationExecutor<P> executor = registrationExecutorFactory.getSingleton(variant.getExecutorClass());
|
||||||
if (executor.isRegistrationAdmitted(parameters)) {
|
if (executor.isRegistrationAdmitted(parameters)) {
|
||||||
executeRegistration(parameters, executor);
|
executeRegistration(parameters, executor);
|
||||||
@ -57,7 +57,7 @@ public class AsyncRegister implements AsynchronousProcess {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean preRegisterCheck(Player player) {
|
private boolean preRegisterCheck(RegistrationMethod<?> variant, Player player) {
|
||||||
final String name = player.getName().toLowerCase();
|
final String name = player.getName().toLowerCase();
|
||||||
if (playerCache.isAuthenticated(name)) {
|
if (playerCache.isAuthenticated(name)) {
|
||||||
service.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
service.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||||
@ -70,7 +70,7 @@ public class AsyncRegister implements AsynchronousProcess {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isPlayerIpAllowedToRegister(player);
|
return variant == RegistrationMethod.API_REGISTRATION || isPlayerIpAllowedToRegister(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user