|
|
|
@ -111,7 +111,7 @@ public class OTPManagementServiceImpl implements OTPManagementService {
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
Timestamp currentTimestamp = new Timestamp(calendar.getTime().getTime());
|
|
|
|
|
Timestamp expiredTimestamp = new Timestamp(
|
|
|
|
|
oneTimePinDTO.getCreatedAt().getTime() + oneTimePinDTO.getExpiryTime() * 1000);
|
|
|
|
|
oneTimePinDTO.getCreatedAt().getTime() + oneTimePinDTO.getExpiryTime() * 1000L);
|
|
|
|
|
|
|
|
|
|
if (currentTimestamp.after(expiredTimestamp)) {
|
|
|
|
|
String renewedOTP = UUID.randomUUID().toString();
|
|
|
|
@ -122,6 +122,8 @@ public class OTPManagementServiceImpl implements OTPManagementService {
|
|
|
|
|
Properties props = new Properties();
|
|
|
|
|
props.setProperty("first-name", tenant.getAdminFirstName());
|
|
|
|
|
props.setProperty("otp-token", renewedOTP);
|
|
|
|
|
props.setProperty("email", oneTimePinDTO.getEmail());
|
|
|
|
|
props.setProperty("type", oneTimePinDTO.getEmailType());
|
|
|
|
|
sendMail(props, oneTimePinDTO.getEmail(), DeviceManagementConstants.EmailAttributes.USER_VERIFY_TEMPLATE);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|