Added configuration to disable auto logins for 2Factor authentication

(Fixes #65)
This commit is contained in:
games647
2016-09-09 16:52:44 +02:00
parent 5022c9aa7b
commit 8e5da01be0
4 changed files with 25 additions and 5 deletions

View File

@ -1,12 +1,13 @@
######1.9
* Added second attempt login -> cracked login
* Add cracked whitelist (switch-mode -> switching to online-mode from offlinemode)
* Added configuration to disable auto logins for 2Factor authentication
* Add missing add-premium-other message
* Fix ProtocolSupport autoRegister
* Fix update username in FastLogin database after nameChange
* Fix logging exceptions on encryption enabling
* Add missing add-premium-other message
* Fix compatibility with older ProtocolLib versions (for 1.7) because of the missing getMethodAcccessorOrNull method
* Add cracked whitelist (switch-mode -> switching to online-mode from offlinemode)
* Fix correct cracked permission for bukkit
* A try to fix SQLite timestamp parsing

View File

@ -52,10 +52,14 @@ public class ForceLoginTask implements Runnable {
} else {
boolean success = false;
if (isOnlineThreadSafe()) {
if (session.needsRegistration()) {
success = forceRegister(authPlugin, player);
if (plugin.getConfig().getBoolean("autoLogin")) {
if (session.needsRegistration()) {
success = forceRegister(authPlugin, player);
} else {
success = forceLogin(authPlugin, player);
}
} else {
success = forceLogin(authPlugin, player);
success = true;
}
}

View File

@ -43,6 +43,14 @@ public class ForceLoginTask implements Runnable {
if (pendingConnection.isOnlineMode()) {
boolean autoRegister = session.needsRegistration();
//2fa authentication - no need to send bukkit force login notification and so we also don't need
// to wait for a response -> save immediatly
if (!plugin.getConfig().getBoolean("autoLogin")) {
playerProfile.setPremium(true);
plugin.getCore().getStorage().save(playerProfile);
session.setAlreadySaved(true);
}
BungeeAuthPlugin authPlugin = plugin.getBungeeAuthPlugin();
if (authPlugin == null) {
//save will happen on success message from bukkit

View File

@ -144,6 +144,13 @@ ip-addresses: []
# If you want to join the discussion visit this: https://github.com/games647/FastLogin/issues/27#issuecomment-226954350
mojang-request-limit: 600
# This disables the auto login from fastlogin. So a premium (like a paid account) authentication is requested, but
# the player won't be auto logged into the account.
#
# This can be used as 2Factor authentication for better security of your accounts. A hacker then needs both passwords.
# The password of your minecraft and the password to login in with your auth plugin
autoLogin: true
# Database configuration
# Recommened is the use of MariaDB (a better version of MySQL)