Allow spaces when checking 2FA codes

This commit is contained in:
cnr 2017-01-19 16:13:12 -06:00
parent fded8a6583
commit 8fdbe87d1d

View File

@ -180,7 +180,7 @@ public class TwoFactorAuth extends MiniClientPlugin<TwoFactorData>
TwoFactorData data = Get(player);
if (data.getLastLoginIp().isPresent() && player.getAddress().getAddress().toString().substring(1).equals(data.getLastLoginIp().get()) || _clientManager.Get(player).GetRank(true) == Rank.SUPPORT)
if ((data.getLastLoginIp().isPresent() && player.getAddress().getAddress().toString().substring(1).equals(data.getLastLoginIp().get())) || _clientManager.Get(player).GetRank(true) == Rank.SUPPORT)
{
player.sendMessage(F.main("2FA", "Authenticated"));
return;
@ -241,7 +241,7 @@ public class TwoFactorAuth extends MiniClientPlugin<TwoFactorData>
int code;
try
{
code = Integer.parseInt(event.getMessage());
code = Integer.parseInt(event.getMessage().replaceAll(" ", ""));
}
catch (NumberFormatException e)
{