[PR #8914] [MERGED] docs(email): document beforeEmailVerification and onExistingUserSignUp callbacks #16540

Closed
opened 2026-04-13 10:33:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8914
Author: @nphlp
Created: 4/2/2026
Status: Merged
Merged: 4/8/2026
Merged by: @ping-maxwell

Base: mainHead: docs/lifecycle-callbacks


📝 Commits (2)

  • ad68e41 docs(email): document beforeEmailVerification and onExistingUserSignUp callbacks
  • 4fdd756 Merge branch 'main' into docs/lifecycle-callbacks

📊 Changes

2 files changed (+44 additions, -0 deletions)

View changed files

📝 .gitignore (+5 -0)
📝 docs/content/docs/concepts/email.mdx (+39 -0)

📄 Description

Summary

Two existing callbacks in emailVerification and emailAndPassword were undocumented:

  • beforeEmailVerification — triggered just before a user's email is marked as verified. Useful for validation or data preparation.
  • onExistingUserSignUp — triggered when someone tries to sign up with an email that already exists. Useful for notifying the existing user. Only called when requireEmailVerification: true or autoSignIn: false.

Both callbacks existed in the code and types (init-options.ts) but were missing from the conceptual documentation.

Added documentation

  • email.mdx: new "Callback before email verification" section with example, new "Callback on duplicate sign-up attempt" section with example and Callout on activation conditions

Changed files (2 files, +44)

  • docs/content/docs/concepts/email.mdx — 2 new sections
  • .gitignore — add docs/.source/ and landing/.source/ (generated files after landingdocs merge)

Summary by cubic

Document beforeEmailVerification (runs before an email is marked verified) and onExistingUserSignUp (fires on duplicate sign-ups when emailAndPassword.requireEmailVerification: true) in the email docs, with examples and a callout. Update .gitignore to ignore generated docs/.source/ and landing/.source/.

Written for commit 4fdd7567df. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/8914 **Author:** [@nphlp](https://github.com/nphlp) **Created:** 4/2/2026 **Status:** ✅ Merged **Merged:** 4/8/2026 **Merged by:** [@ping-maxwell](https://github.com/ping-maxwell) **Base:** `main` ← **Head:** `docs/lifecycle-callbacks` --- ### 📝 Commits (2) - [`ad68e41`](https://github.com/better-auth/better-auth/commit/ad68e4199d104e993264c37853574d7516834520) docs(email): document beforeEmailVerification and onExistingUserSignUp callbacks - [`4fdd756`](https://github.com/better-auth/better-auth/commit/4fdd7567df4f6a366b2747508c847bf256310dca) Merge branch 'main' into docs/lifecycle-callbacks ### 📊 Changes **2 files changed** (+44 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+5 -0) 📝 `docs/content/docs/concepts/email.mdx` (+39 -0) </details> ### 📄 Description ## Summary Two existing callbacks in `emailVerification` and `emailAndPassword` were undocumented: - **`beforeEmailVerification`** — triggered just before a user's email is marked as verified. Useful for validation or data preparation. - **`onExistingUserSignUp`** — triggered when someone tries to sign up with an email that already exists. Useful for notifying the existing user. Only called when `requireEmailVerification: true` or `autoSignIn: false`. Both callbacks existed in the code and types (`init-options.ts`) but were missing from the conceptual documentation. ### Added documentation - **`email.mdx`**: new "Callback before email verification" section with example, new "Callback on duplicate sign-up attempt" section with example and Callout on activation conditions ### Changed files (2 files, +44) - `docs/content/docs/concepts/email.mdx` — 2 new sections - `.gitignore` — add `docs/.source/` and `landing/.source/` (generated files after `landing` → `docs` merge) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Document `beforeEmailVerification` (runs before an email is marked verified) and `onExistingUserSignUp` (fires on duplicate sign-ups when `emailAndPassword.requireEmailVerification: true`) in the email docs, with examples and a callout. Update `.gitignore` to ignore generated `docs/.source/` and `landing/.source/`. <sup>Written for commit 4fdd7567df4f6a366b2747508c847bf256310dca. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 10:33:58 -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#16540