Update MaxKeyConfig.java

This commit is contained in:
shimingxy
2020-05-31 12:18:50 +08:00
parent 4b197b9c33
commit 2919ed8d6a

View File

@@ -186,7 +186,8 @@ public class MaxKeyConfig implements InitializingBean {
//default tfaOptAuthn
@Bean(name = "tfaOptAuthn")
public AbstractOptAuthn tfaOptAuthn(
@Value("${config.login.mfa.type}")String mfaType) {
@Value("${config.login.mfa.type}")String mfaType,
MailOtpAuthn tfaMailOptAuthn) {
if(mfaType.equalsIgnoreCase("SmsOtpAuthnAliyun")) {
SmsOtpAuthnAliyun tfaOptAuthn = new SmsOtpAuthnAliyun();
@@ -203,6 +204,9 @@ public class MaxKeyConfig implements InitializingBean {
tfaOptAuthn.initPropertys();
_logger.debug("SmsOtpAuthnYunxin inited.");
return tfaOptAuthn;
}else if(mfaType.equalsIgnoreCase("MailOtpAuthn")) {
_logger.debug("MailOtpAuthn inited.");
return tfaMailOptAuthn;
}else {
TimeBasedOtpAuthn tfaOptAuthn = new TimeBasedOtpAuthn();
_logger.debug("TimeBasedOtpAuthn inited.");