diff --git a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/integration/OTPManager.java b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/integration/OTPManager.java index ccb8f6a0a5f..8b1ca346976 100644 --- a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/integration/OTPManager.java +++ b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/integration/OTPManager.java @@ -99,7 +99,7 @@ public boolean sendOtp(OtpRequestDTO otpRequestDTO, String idvid, String idvidTy if(otpEntityOpt.isPresent()) { OtpTransaction otpEntity = otpEntityOpt.get(); if(otpEntity.getStatusCode().equals(IdAuthCommonConstants.FROZEN)) { - if(checkFrozenStatusAndDuration(otpEntity)) { + if(isAfterFrozenDuration(otpEntity)) { logger.info("OTP Frozen wait time is over. Allowing further."); otpEntity.setValidationRetryCount(0); otpEntity.setStatusCode(IdAuthCommonConstants.ACTIVE_STATUS); @@ -198,7 +198,7 @@ public boolean validateOtp(String pinValue, String otpKey, String individualId) OtpTransaction otpEntity = otpEntityOpt.get(); if(otpEntity.getStatusCode().equals(IdAuthCommonConstants.FROZEN)) { - if(otpEntity.getUpdDTimes() != null && checkFrozenStatusAndDuration(otpEntity)) { + if(otpEntity.getUpdDTimes() != null && isAfterFrozenDuration(otpEntity)) { logger.info("OTP Frozen wait time is over. Allowing further."); otpEntity.setValidationRetryCount(0); otpEntity.setStatusCode(IdAuthCommonConstants.ACTIVE_STATUS); @@ -239,7 +239,7 @@ public boolean validateOtp(String pinValue, String otpKey, String individualId) } } - private boolean checkFrozenStatusAndDuration(OtpTransaction otpEntity) { + private boolean isAfterFrozenDuration(OtpTransaction otpEntity) { return DateUtils.getUTCCurrentDateTime().isAfter(otpEntity.getUpdDTimes().plus(otpFrozenTimeMinutes, ChronoUnit.MINUTES)); }