'How to implement Allowing less than 5 OTP requests for newsletter subscription in a day in asp .net core c#
I am working on a asp .net core 6.0 project
I do a function for newsletter subscription. we need to get verification from user to subscribe. To verify the OPT user sent should match the OPT we sent.
if not match user can re-send OTP.
But user could not request for OTP send more than 5 in a day. if send request 6th time ban the email and a OTP should valid only 30mins
my NewsLetterOTP.cs
public class NewsLetterOTP
{
public int Id { get; set; }
public string Email { get; set; }
public string Otp { get; set; }
public int Attempt { get; set; } // is this right?
public bool Status { get; set; }
}
How to implement this? How to change the status of OTP after 30 mins. How to save how many Attempt per a day?
anyone give idea please..
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
