[PR #4621] [MERGED] feat: flip emailVerified when link the account #22390

Closed
opened 2026-04-15 21:00:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4621
Author: @himself65
Created: 9/12/2025
Status: Merged
Merged: 9/15/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/12/verify


📝 Commits (5)

  • 204ccb4 feat: flip emailVerified when link the account
  • f621242 feat: flip emailVerified when link the account
  • 8b6cbc4 Merge branch 'canary' into himself65/2025/09/12/verify
  • fef3b99 fix: lowercase
  • a828e10 fix: move

📊 Changes

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

View changed files

packages/better-auth/src/oauth2/link-account.test.ts (+222 -0)
📝 packages/better-auth/src/oauth2/link-account.ts (+20 -0)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4615

Summary by cubic

Auto-verifies a user’s email when linking a social account if the provider confirms it and the email matches the user’s. This helps unverified email/password users become verified after linking Google.

  • New Features
    • Updates emailVerified in both link-account paths.
    • Uses strict checks (email match + provider-verified) to prevent false positives.
    • Adds tests for verified, unverified, mismatched, and already-verified cases.

🔄 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/4621 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/12/2025 **Status:** ✅ Merged **Merged:** 9/15/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/12/verify` --- ### 📝 Commits (5) - [`204ccb4`](https://github.com/better-auth/better-auth/commit/204ccb469f35e40e88f5b08055a2536c62bee04b) feat: flip emailVerified when link the account - [`f621242`](https://github.com/better-auth/better-auth/commit/f621242081df50212845b2af33d8a98f0d9db7cd) feat: flip emailVerified when link the account - [`8b6cbc4`](https://github.com/better-auth/better-auth/commit/8b6cbc403a3bc1c5cd7092d62a923427b10599d7) Merge branch 'canary' into himself65/2025/09/12/verify - [`fef3b99`](https://github.com/better-auth/better-auth/commit/fef3b99ec5ae2fcd44132fe747f47f52cdf2356e) fix: lowercase - [`a828e10`](https://github.com/better-auth/better-auth/commit/a828e109db251fd8e090c33bb020a817f19d9b8b) fix: move ### 📊 Changes **2 files changed** (+242 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `packages/better-auth/src/oauth2/link-account.test.ts` (+222 -0) 📝 `packages/better-auth/src/oauth2/link-account.ts` (+20 -0) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4615 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Auto-verifies a user’s email when linking a social account if the provider confirms it and the email matches the user’s. This helps unverified email/password users become verified after linking Google. - **New Features** - Updates emailVerified in both link-account paths. - Uses strict checks (email match + provider-verified) to prevent false positives. - Adds tests for verified, unverified, mismatched, and already-verified cases. <!-- 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 21:00:49 -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#22390