[PR #6528] [MERGED] fix(core): allow returning null in getUserInfo in provider options #23628

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6528
Author: @Zollerboy1
Created: 12/4/2025
Status: Merged
Merged: 12/4/2025
Merged by: @himself65

Base: canaryHead: fix/provider-options-get-user-info-type


📝 Commits (1)

  • d7f2a78 fix(core): allow returning null in getUserInfo in provider options

📊 Changes

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

View changed files

📝 packages/core/src/oauth2/oauth-provider.ts (+1 -1)

📄 Description

This PR allows users that want to customize the getUserInfo function for a social provider to return null when something goes wrong. Especially, this means that it becomes possible to copy the default implementation from the better auth source code (which often does return null) and tweak something minor with it.


Summary by cubic

Allow custom social provider getUserInfo to return null, matching the default behavior and enabling safer error handling. Updated ProviderOptions type to accept null for getUserInfo results; no runtime changes.

Written for commit d7f2a78784. 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/6528 **Author:** [@Zollerboy1](https://github.com/Zollerboy1) **Created:** 12/4/2025 **Status:** ✅ Merged **Merged:** 12/4/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/provider-options-get-user-info-type` --- ### 📝 Commits (1) - [`d7f2a78`](https://github.com/better-auth/better-auth/commit/d7f2a78784dec25238aff1ec39021060aecc8eed) fix(core): allow returning null in getUserInfo in provider options ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/oauth2/oauth-provider.ts` (+1 -1) </details> ### 📄 Description This PR allows users that want to customize the `getUserInfo` function for a social provider to return null when something goes wrong. Especially, this means that it becomes possible to copy the default implementation from the better auth source code (which often does return null) and tweak something minor with it. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Allow custom social provider getUserInfo to return null, matching the default behavior and enabling safer error handling. Updated ProviderOptions type to accept null for getUserInfo results; no runtime changes. <sup>Written for commit d7f2a78784dec25238aff1ec39021060aecc8eed. 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-15 21:52: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#23628