[PR #6106] [MERGED] fix: remove active session requirement for change email verification #32049

Closed
opened 2026-04-17 22:54:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6106
Author: @Bekacru
Created: 11/19/2025
Status: Merged
Merged: 11/22/2025
Merged by: @Bekacru

Base: canaryHead: fix/email-change


📝 Commits (1)

  • 72e2df4 fix: remove active session requirement for change email verification

📊 Changes

1 file changed (+17 additions, -14 deletions)

View changed files

📝 packages/better-auth/src/api/routes/email-verification.ts (+17 -14)

📄 Description

closes #5978


Summary by cubic

Removed the active session requirement for change-email verification so users can confirm email changes without being logged in. Keeps security by rejecting when a logged-in session doesn't match the token email, and creates a session if needed to complete the flow.

  • Bug Fixes
    • Allow verification without an active session; only deny when a session exists for a different email.
    • Create a session for the user if none exists to complete change-email verification; return an error if creation fails.
    • Send verification email using the token’s user data instead of the session user.

Written for commit 72e2df4314. Summary will update automatically 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/6106 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 11/19/2025 **Status:** ✅ Merged **Merged:** 11/22/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/email-change` --- ### 📝 Commits (1) - [`72e2df4`](https://github.com/better-auth/better-auth/commit/72e2df4314c8cc8d0c7b269ee25981199bd26daa) fix: remove active session requirement for change email verification ### 📊 Changes **1 file changed** (+17 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+17 -14) </details> ### 📄 Description closes #5978 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed the active session requirement for change-email verification so users can confirm email changes without being logged in. Keeps security by rejecting when a logged-in session doesn't match the token email, and creates a session if needed to complete the flow. - **Bug Fixes** - Allow verification without an active session; only deny when a session exists for a different email. - Create a session for the user if none exists to complete change-email verification; return an error if creation fails. - Send verification email using the token’s user data instead of the session user. <sup>Written for commit 72e2df4314c8cc8d0c7b269ee25981199bd26daa. Summary will update automatically 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-17 22:54:56 -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#32049