[GH-ISSUE #5310] Add calback for two-factor/verify-otp #10211

Open
opened 2026-04-13 06:11:46 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @gregoiregentil on GitHub (Oct 14, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5310

Originally assigned to: @ping-maxwell on GitHub.

Is this suited for github?

  • Yes, this is suited for github

No response

Describe the solution you'd like

It would be very worthwhile to get a server callback when two-factor/verify-otp is called (similarly to sendOtp). Because if you have your own OTP mechanism, which doesn't simply consist of sending a SMS, you might want to do some clean-up or some actions when verify-otp is triggered successfully or unsuccessfuly.

Describe alternatives you've considered

I hacked hooks createAuthMiddleware. I think it's reliable but it's not clean as I start to pile-up patched logic in hooks.

Additional context

No response

Originally created by @gregoiregentil on GitHub (Oct 14, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5310 Originally assigned to: @ping-maxwell on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like It would be very worthwhile to get a server callback when two-factor/verify-otp is called (similarly to sendOtp). Because if you have your own OTP mechanism, which doesn't simply consist of sending a SMS, you might want to do some clean-up or some actions when verify-otp is triggered successfully or unsuccessfuly. ### Describe alternatives you've considered I hacked hooks createAuthMiddleware. I think it's reliable but it's not clean as I start to pile-up patched logic in hooks. ### Additional context _No response_
GiteaMirror added the credentialssecurity labels 2026-04-13 06:11:46 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 13, 2026):

Hi, @gregoiregentil. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary

  • You requested a server callback for the two-factor/verify-otp endpoint similar to the existing sendOtp callback.
  • The purpose is to support custom OTP mechanisms and enable actions or clean-up after OTP verification success or failure.
  • This would help avoid less clean workarounds like patching hooks.
  • No further activity or comments have been posted on this request.

Next Steps

  • Please let me know if this feature is still relevant to the latest version of better-auth by commenting on this issue.
  • If I don’t hear back within 7 days, I will automatically close this issue.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3745193064 --> @dosubot[bot] commented on GitHub (Jan 13, 2026): Hi, @gregoiregentil. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary** - You requested a server callback for the two-factor/verify-otp endpoint similar to the existing sendOtp callback. - The purpose is to support custom OTP mechanisms and enable actions or clean-up after OTP verification success or failure. - This would help avoid less clean workarounds like patching hooks. - No further activity or comments have been posted on this request. **Next Steps** - Please let me know if this feature is still relevant to the latest version of better-auth by commenting on this issue. - If I don’t hear back within 7 days, I will automatically close this issue. Thank you for your understanding and contribution!
Author
Owner

@gregoiregentil commented on GitHub (Jan 13, 2026):

This issue is still relevant for me and the description is still accurate even with latest version.

<!-- gh-comment-id:3746426807 --> @gregoiregentil commented on GitHub (Jan 13, 2026): This issue is still relevant for me and the description is still accurate even with latest version.
Author
Owner

@AmariUwU commented on GitHub (Feb 5, 2026):

@himself65

<!-- gh-comment-id:3854043689 --> @AmariUwU commented on GitHub (Feb 5, 2026): @himself65
Author
Owner

@AmariUwU commented on GitHub (Mar 27, 2026):

?? @ping-maxwell

<!-- gh-comment-id:4144138948 --> @AmariUwU commented on GitHub (Mar 27, 2026): ?? @ping-maxwell
Author
Owner

@gregoiregentil commented on GitHub (Mar 27, 2026):

I deplore the closure of this issue. 😟

<!-- gh-comment-id:4144881528 --> @gregoiregentil commented on GitHub (Mar 27, 2026): I deplore the closure of this issue. 😟
Author
Owner

@ping-maxwell commented on GitHub (Mar 27, 2026):

sorry guys, closed by mistake

<!-- gh-comment-id:4145326925 --> @ping-maxwell commented on GitHub (Mar 27, 2026): sorry guys, closed by mistake
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10211