[GH-ISSUE #7002] onUserVerified hook or afterEmailVerification improvement #19328

Open
opened 2026-04-15 18:16:14 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @thyngster on GitHub (Dec 26, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/7002

Is this suited for github?

  • Yes, this is suited for github

Currently, we rely on afterEmailVerification, which is triggered when a user verifies their email through the email sign-up flow.

The problem is that this callback does not fire when using OAuth. For example, a user might first sign up with email and later log in via OAuth, at which point the user is already considered verified.

The core issue is that this logic depends on a callback that is triggered from the /email-verification route, which is never called during OAuth authentication.

Describe the solution you'd like

I understand that afterEmailVerification is intended only for the email sign-up method. However, it feels like it should also be triggered when a user’s email is automatically verified via OAuth.

Perhaps we could introduce a configuration option or flag that allows this verification callback to fire for OAuth-based sign-ins as well, while still allowing others to keep it restricted to email-only verification if they prefer.

Describe alternatives you've considered

And another option would be having a global onUserVerified that trigger whenever the user verified status changes to TRUE.

Additional context

No response

Originally created by @thyngster on GitHub (Dec 26, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/7002 ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Currently, we rely on afterEmailVerification, which is triggered when a user verifies their email through the email sign-up flow. The problem is that this callback does not fire when using OAuth. For example, a user might first sign up with email and later log in via OAuth, at which point the user is already considered verified. The core issue is that this logic depends on a callback that is triggered from the /email-verification route, which is never called during OAuth authentication. ### Describe the solution you'd like I understand that afterEmailVerification is intended only for the email sign-up method. However, it feels like it should also be triggered when a user’s email is automatically verified via OAuth. Perhaps we could introduce a configuration option or flag that allows this verification callback to fire for OAuth-based sign-ins as well, while still allowing others to keep it restricted to email-only verification if they prefer. ### Describe alternatives you've considered And another option would be having a global onUserVerified that trigger whenever the user verified status changes to TRUE. ### Additional context _No response_
GiteaMirror added the credentials label 2026-04-15 18:16:14 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 26, 2025):

Thank you for your input regarding the afterEmailVerification hook! It seems that you are suggesting an improvement for how verification callbacks are handled, particularly when users verify their email through OAuth instead of the traditional email sign-up flow.

Currently, there is an open discussion on this topic and suggestions include introducing a configuration option to trigger afterEmailVerification during OAuth sign-ins as well. Another option proposed is creating a onUserVerified hook that would be triggered any time a user's verification status changes to true. These potential improvements demonstrate a flexible approach to enhancing user verification flows in Better Auth.

If you have more specific use cases or features in mind regarding this topic, please feel free to share! It would greatly benefit the development team to have detailed scenarios to consider.

Tag @better-auth-agent if you would like an answer from the Agent!

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3691867941 --> @better-auth-agent[bot] commented on GitHub (Dec 26, 2025): Thank you for your input regarding the `afterEmailVerification` hook! It seems that you are suggesting an improvement for how verification callbacks are handled, particularly when users verify their email through OAuth instead of the traditional email sign-up flow. Currently, there is an open discussion on this topic and suggestions include introducing a configuration option to trigger `afterEmailVerification` during OAuth sign-ins as well. Another option proposed is creating a `onUserVerified` hook that would be triggered any time a user's verification status changes to true. These potential improvements demonstrate a flexible approach to enhancing user verification flows in Better Auth. If you have more specific use cases or features in mind regarding this topic, please feel free to share! It would greatly benefit the development team to have detailed scenarios to consider. Tag @better-auth-agent if you would like an answer from the Agent! _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@gustavovalverde commented on GitHub (Apr 14, 2026):

Related in the same area (not duplicates): #3742, #8043.

<!-- gh-comment-id:4244779848 --> @gustavovalverde commented on GitHub (Apr 14, 2026): Related in the same area (not duplicates): #3742, #8043.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19328