laravel-otp-validate icon indicating copy to clipboard operation
laravel-otp-validate copied to clipboard

Resend Service is disabled code 503 is working wrong

Open ihemantkumar opened this issue 1 year ago • 1 comments

I have setup max-send and max-resend to 5 and after requesting the OTP twice one using OtpValidator::requestOtp() and another using OtpValidator::validateOtp() code is showing error Resend Service is disabled with code: 503

When I checked the database, I found there was 1 entry for today, 1 from 6 days earlier and 4 entries from 20 days ago. It seems plugin is only checking the old OTP entries via client_req_id instead of client_req_id + created_at.

Upon more inspection I found that the core method countResend() is just using client_req_id and type to fetch the resend count. The query should have included the time as well.

Screenshot from 2023-09-12 23-36-15

ihemantkumar avatar Sep 12 '23 17:09 ihemantkumar

Thanks for the suggestion, let me work on it

ferdousulhaque avatar Oct 06 '23 09:10 ferdousulhaque