Skip to content

Commit 1467509

Browse files
committed
- added option to disable 2fa auth
1 parent a9861f3 commit 1467509

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/main/java/org/kasun/opprotector/Configs/MainConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class MainConfig {
4545
notify_op_leave,
4646
notify_auth_success,
4747
notify_auth_failed,
48+
tfa_enabled,
4849
notify_unauth_access;
4950

5051

@@ -83,6 +84,7 @@ private void loadPasswordSettings(){
8384
interval_secounds = password.getInt("interval-secounds");
8485
use_gui = password.getBoolean("use-gui");
8586
encrypt_passwords = password.getBoolean("encrypt-passwords");
87+
tfa_enabled = password.getBoolean("2fa-enabled");
8688
}
8789

8890
private void loadLockdownSettings(){

src/main/java/org/kasun/opprotector/VerificationProcess/VerificationProcessManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ public void start(Player player){
9797
}
9898

9999
public void setTo2FA(Player player){
100+
101+
if (!plugin.getMainManager().getConfigManager().getMainConfig().tfa_enabled){
102+
setVerified(player);
103+
}
104+
100105
passwordFlash.stopTasks();
101106
verificationStatusMap.put(player.getName(), VerificationStatus.IN_FACTOR_VERIFICATION);
102107
plugin.getMainManager().getAuthorizedPlayers().addAuthorizedPlayer(player);

src/main/resources/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ password-settings:
1818
interval-secounds: 20
1919
pas-command: "pas"
2020
encrypt-passwords: true
21+
2fa-enabled: true
2122

2223
#===============================================================================
2324
# Lockdown Settings

0 commit comments

Comments
 (0)