[PR #7181] [MERGED] fix: correctly handle OAuth callback and Apple email field #24027

Closed
opened 2026-04-15 22:08:07 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: canaryHead: 2026-01-08/fix/oauth-apple-provider


📝 Commits (4)

  • 547f920 fix: handle name field with space instead of passing email
  • a7e612b fix: add missing user object handling
  • 44e4bb1 test: add name field handling case in apple provider
  • 51dbba1 Merge branch 'canary' into 2026-01-08/fix/oauth-apple-provider

📊 Changes

3 files changed (+207 additions, -5 deletions)

View changed files

📝 packages/better-auth/src/api/routes/callback.ts (+23 -2)
📝 packages/better-auth/src/social.test.ts (+172 -0)
📝 packages/core/src/social-providers/apple.ts (+12 -3)

📄 Description

Removing the fallback to use email for the name field. In the next release, once the name field becomes optional, the “ “ masking will be removed.


Summary by cubic

Fixes OAuth callback handling by correctly parsing and forwarding provider user data, and stops using Apple email as a fallback for the user's name. Uses Apple first/last name when provided; otherwise sets name to a single space until the name field becomes optional.

  • Bug Fixes
    • Parse user from callback query/body and pass to provider (supports Apple’s user payload).
    • Apple provider builds name from first/last; no email fallback; uses " " when name is missing.
    • Added tests covering Apple callback and name handling.

Written for commit 51dbba15ba. 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/7181 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/7/2026 **Status:** ✅ Merged **Merged:** 1/14/2026 **Merged by:** [@bytaesu](https://github.com/bytaesu) **Base:** `canary` ← **Head:** `2026-01-08/fix/oauth-apple-provider` --- ### 📝 Commits (4) - [`547f920`](https://github.com/better-auth/better-auth/commit/547f920210d6f9e75f0c3e620e51f4a226ae969d) fix: handle name field with space instead of passing email - [`a7e612b`](https://github.com/better-auth/better-auth/commit/a7e612b3024261fb303080be19a44a4579c0e4e4) fix: add missing user object handling - [`44e4bb1`](https://github.com/better-auth/better-auth/commit/44e4bb19c79bede1e403f0df150480f07dd995d6) test: add name field handling case in apple provider - [`51dbba1`](https://github.com/better-auth/better-auth/commit/51dbba15ba2de212f2662beb3b89d382ee477978) Merge branch 'canary' into 2026-01-08/fix/oauth-apple-provider ### 📊 Changes **3 files changed** (+207 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/callback.ts` (+23 -2) 📝 `packages/better-auth/src/social.test.ts` (+172 -0) 📝 `packages/core/src/social-providers/apple.ts` (+12 -3) </details> ### 📄 Description Removing the fallback to use email for the name field. In the next release, once the name field becomes optional, the “ “ masking will be removed. - Closes https://github.com/better-auth/better-auth/issues/7091 - Closes https://github.com/better-auth/better-auth/issues/7357 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes OAuth callback handling by correctly parsing and forwarding provider user data, and stops using Apple email as a fallback for the user's name. Uses Apple first/last name when provided; otherwise sets name to a single space until the name field becomes optional. - **Bug Fixes** - Parse user from callback query/body and pass to provider (supports Apple’s user payload). - Apple provider builds name from first/last; no email fallback; uses " " when name is missing. - Added tests covering Apple callback and name handling. <sup>Written for commit 51dbba15ba2de212f2662beb3b89d382ee477978. 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-15 22:08:07 -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#24027