[PR #7160] [MERGED] fix: call hooks on change-email-verification flow #7109

Closed
opened 2026-03-13 13:24:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7160
Author: @bytaesu
Created: 1/7/2026
Status: Merged
Merged: 1/7/2026
Merged by: @himself65

Base: canaryHead: 2026-01-07/fix/email-verification-hooks


📝 Commits (1)

  • 74b6bb5 fix: call hooks on change-email-verification flow

📊 Changes

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

View changed files

📝 packages/better-auth/src/api/routes/email-verification.test.ts (+65 -0)
📝 packages/better-auth/src/api/routes/email-verification.ts (+12 -0)

📄 Description


Summary by cubic

Ensure hooks run during the change-email-verification flow so integrators can perform pre/post verification actions. This aligns email change verification with the standard verification behavior.

  • Bug Fixes
    • Call onEmailVerification before updating the email, and afterEmailVerification after the update is saved.
    • Add tests verifying hooks receive the original email on pre-verification and the new, verified email on post-verification.

Written for commit 74b6bb537c. 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/7160 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/7/2026 **Status:** ✅ Merged **Merged:** 1/7/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-01-07/fix/email-verification-hooks` --- ### 📝 Commits (1) - [`74b6bb5`](https://github.com/better-auth/better-auth/commit/74b6bb537c1e677c43d9770281d0a98089d57f01) fix: call hooks on change-email-verification flow ### 📊 Changes **2 files changed** (+77 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/email-verification.test.ts` (+65 -0) 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+12 -0) </details> ### 📄 Description - Closes https://github.com/better-auth/better-auth/issues/7057 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Ensure hooks run during the change-email-verification flow so integrators can perform pre/post verification actions. This aligns email change verification with the standard verification behavior. - **Bug Fixes** - Call onEmailVerification before updating the email, and afterEmailVerification after the update is saved. - Add tests verifying hooks receive the original email on pre-verification and the new, verified email on post-verification. <sup>Written for commit 74b6bb537c1e677c43d9770281d0a98089d57f01. 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-03-13 13:24:25 -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#7109