#1141 Require TOTP code to be passed with /login (temporary)
- Temporarily require the TOTP code to be provided with /login - Future implementation should require it as a second step
This commit is contained in:
@@ -89,6 +89,7 @@ public class CommandInitializer {
|
||||
.description("Login command")
|
||||
.detailedDescription("Command to log in using AuthMeReloaded.")
|
||||
.withArgument("password", "Login password", false)
|
||||
.withArgument("2facode", "TOTP code", true)
|
||||
.permission(PlayerPermission.LOGIN)
|
||||
.executableCommand(LoginCommand.class)
|
||||
.register();
|
||||
|
||||
@@ -77,6 +77,7 @@ class PlayerAuthViewer implements DebugSection {
|
||||
HashedPassword hashedPass = auth.getPassword();
|
||||
sender.sendMessage("Hash / salt (partial): '" + safeSubstring(hashedPass.getHash(), 6)
|
||||
+ "' / '" + safeSubstring(hashedPass.getSalt(), 4) + "'");
|
||||
sender.sendMessage("TOTP code (partial): '" + safeSubstring(auth.getTotpKey(), 3) + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,9 @@ public class LoginCommand extends PlayerCommand {
|
||||
|
||||
@Override
|
||||
public void runCommand(Player player, List<String> arguments) {
|
||||
final String password = arguments.get(0);
|
||||
management.performLogin(player, password);
|
||||
String password = arguments.get(0);
|
||||
String totpCode = arguments.size() > 1 ? arguments.get(1) : null;
|
||||
management.performLogin(player, password, totpCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user