保誠-保戶業務員媒合平台
wayne
2021-11-26 e93c2fa0d3f054f6dd5adef5ecce0c4e58a5ffa9
pamapi/src/main/java/com/pollex/pam/security/provider/OtpAuthenticationProvider.java
@@ -41,10 +41,7 @@
        String indexKey = otpAccount.getIndexKey();
        String otpCode = otpAuthenticationToken.getCredentials();
        otpUtilService.verifyOtp(indexKey, otpCode);
       setVerrifiedOtpTmp(account, indexKey);
        otpUtilService.verifyOtp(account, indexKey, otpCode);
       Customer customer = customerRepository.findOneByEmailEqualsOrPhoneEquals(account)
                      .orElse(null);
       
@@ -55,12 +52,4 @@
       return customerAuthService.buildCustomerAuthToken(customer, otpCode, indexKey);
    }
    private void setVerrifiedOtpTmp(String account, String indexKey) {
       OtpTmp otpTmp = otpTmpService.findByAccountAndIndexKey(account, indexKey);
       otpTmp.setStatus(OtpTmpStatusEnum.VERRIFIED);
       otpTmpService.save(otpTmp);
   }
}