[PR #4504] [MERGED] fix: respect allow different email linking option on callbacks #22315

Closed
opened 2026-04-15 20:57:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4504
Author: @Bekacru
Created: 9/7/2025
Status: Merged
Merged: 9/7/2025
Merged by: @Bekacru

Base: canaryHead: fix/respect-email-linking


📝 Commits (2)

  • 55b81bd fix: respsect different email linking option
  • e5d7375 change error code

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/api/routes/callback.ts (+7 -0)

📄 Description

closes #4503


Summary by cubic

Fixed OAuth account linking to respect the accountLinking.allowDifferentEmails option. When the provider email and the account email differ and the option isn’t enabled, linking is blocked and the flow redirects with different_emails_not_allowed.


🔄 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/4504 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 9/7/2025 **Status:** ✅ Merged **Merged:** 9/7/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/respect-email-linking` --- ### 📝 Commits (2) - [`55b81bd`](https://github.com/better-auth/better-auth/commit/55b81bd8d6c3185e1797d5647703e3f9b8104c33) fix: respsect different email linking option - [`e5d7375`](https://github.com/better-auth/better-auth/commit/e5d73752efcee272016d732f37ec1286aa783850) change error code ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/callback.ts` (+7 -0) </details> ### 📄 Description closes #4503 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixed OAuth account linking to respect the accountLinking.allowDifferentEmails option. When the provider email and the account email differ and the option isn’t enabled, linking is blocked and the flow redirects with different_emails_not_allowed. <!-- 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-15 20:57:34 -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#22315