| | |
| | | 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); |
| | | |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |