[ADD] 新增OTP檢核, 驗證之前需要先檢查帳號跟index key有沒有符合, todo : 171002
| | |
| | | |
| | | @Transactional |
| | | public void verifyOtp(String account, String indexKey, String otpCode) { |
| | | if (applicationProperty.isMockLogin()) { |
| | | |
| | | OtpTmp otpTmp = otpTmpService.findByAccountAndIndexKey(account, indexKey); |
| | | if(otpTmp==null) { |
| | | log.info("otp login fail... , account = {}, indexKey = {}, failReason = {}", account, indexKey, "Index key and account field mismatch"); |
| | | throw new OtpLoginFailException("otp error"); |
| | | } |
| | | |
| | | if (applicationProperty.isMockLogin()) { |
| | | log.debug("Do MockLogin"); |
| | | } else { // otp logon |
| | | OtpResponseDTO otpResponseDTO = otpWebService.verifyOTP(indexKey, otpCode); |
| | | |
| | | OtpResponseDTO otpResponseDTO = otpWebService.verifyOTP(indexKey, otpCode); |
| | | if (otpResponseDTO.isSuccess()) { |
| | | log.info("otp login success!, account = {}", account); |
| | | } |