[GH-ISSUE #388] Verify last OTP code #16877

Closed
opened 2026-04-15 14:51:42 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @AmineYagoub on GitHub (Nov 1, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/388

Describe the bug
When user resend OTP code many times and hi get the code in the third or fourth try, this code is stored in DB as last code sent by better-auth, but when the user provide this code to the verification , this lib try to verify it with the first one

To Reproduce
just resend OTP code many times and suppose you only get the last one

Expected behavior
I think this should be resolved by validating the last code sent and delete all old verification that have same identifier

Originally created by @AmineYagoub on GitHub (Nov 1, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/388 **Describe the bug** When user resend OTP code many times and hi get the code in the third or fourth try, this code is stored in DB as last code sent by better-auth, but when the user provide this code to the verification , this lib try to verify it with the first one **To Reproduce** just resend OTP code many times and suppose you only get the last one **Expected behavior** I think this should be resolved by validating the last code sent and delete all old verification that have same identifier
GiteaMirror added the locked label 2026-04-15 14:51:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16877