Skip to content

Commit

Permalink
OTP manager changes done
Browse files Browse the repository at this point in the history
Signed-off-by: Neha Farheen <[email protected]>
  • Loading branch information
Neha Farheen committed Feb 9, 2024
1 parent 0e35e62 commit 1ca6f06
Showing 1 changed file with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,18 @@ public boolean sendOtp(OtpRequestDTO otpRequestDTO, String idvid, String idvidTy
+ EnvUtil.getKeySplitter() + otpRequestDTO.getTransactionID()
+ EnvUtil.getKeySplitter() + otp).getBytes());

OtpTransaction otpTxn;
if (otpEntityOpt.isPresent()
&& (otpTxn = otpEntityOpt.get()).getStatusCode().equals(IdAuthCommonConstants.ACTIVE_STATUS)) {
otpTxn.setOtpHash(otpHash);
otpTxn.setUpdBy(securityManager.getUser());
otpTxn.setUpdDTimes(otpGenerationTime);
otpTxn.setExpiryDtimes(otpGenerationTime.plusSeconds(EnvUtil.getOtpExpiryTime()));
otpRepo.save(otpTxn);
} else {
OtpTransaction txn = new OtpTransaction();
txn.setId(UUID.randomUUID().toString());
txn.setRefId(securityManager.hash(otpRequestDTO.getIndividualId()));
txn.setOtpHash(otpHash);
txn.setCrBy(securityManager.getUser());
txn.setCrDtimes(otpGenerationTime);
txn.setExpiryDtimes(otpGenerationTime.plusSeconds(
EnvUtil.getOtpExpiryTime()));
txn.setStatusCode(IdAuthCommonConstants.ACTIVE_STATUS);
otpRepo.save(txn);
}
OtpTransaction txn = new OtpTransaction();
txn.setId(UUID.randomUUID().toString());
txn.setRefId(securityManager.hash(otpRequestDTO.getIndividualId()));
txn.setOtpHash(otpHash);
txn.setCrBy(securityManager.getUser());
txn.setGeneratedDtimes(otpGenerationTime);
txn.setCrDtimes(otpGenerationTime);
txn.setExpiryDtimes(otpGenerationTime.plusSeconds(
EnvUtil.getOtpExpiryTime()));
txn.setStatusCode(IdAuthCommonConstants.ACTIVE_STATUS);
otpRepo.save(txn);

String notificationProperty = null;
notificationProperty = otpRequestDTO
.getOtpChannel().stream().map(channel -> NotificationType.getNotificationTypeForChannel(channel)
Expand Down

0 comments on commit 1ca6f06

Please sign in to comment.