[PR #5894] [MERGED] fix(oauth2): fix user data not reflecting provider updates with overrideUserInfo #23204

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5894
Author: @dandamian
Created: 11/11/2025
Status: Merged
Merged: 11/11/2025
Merged by: @himself65

Base: canaryHead: fix/oauth2-override-info


📝 Commits (3)

  • c7b5247 fix(oauth2): fix user data not reflecting provider updates with overrideUserInfo
  • a264f8d Test case for user info override fix
  • ac9664c Use cookieCache instead of secondaryStorage in test

📊 Changes

2 files changed (+105 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/oauth2/link-account.test.ts (+104 -1)
📝 packages/better-auth/src/oauth2/link-account.ts (+1 -1)

📄 Description

When overrideUserInfo is enabled, updateUser() was called but its return value wasn't captured, causing sessions to be created with stale user data instead of the updated information from the OAuth provider.


Summary by cubic

Fixed OAuth sessions using stale user data when overrideUserInfo is enabled. We now assign the result of updateUser to the user object so sessions reflect provider updates on sign-in and account linking.

Written for commit ac9664c3b2. 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/5894 **Author:** [@dandamian](https://github.com/dandamian) **Created:** 11/11/2025 **Status:** ✅ Merged **Merged:** 11/11/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/oauth2-override-info` --- ### 📝 Commits (3) - [`c7b5247`](https://github.com/better-auth/better-auth/commit/c7b5247644b855a2dfb00eb851456662dd8df5c8) fix(oauth2): fix user data not reflecting provider updates with overrideUserInfo - [`a264f8d`](https://github.com/better-auth/better-auth/commit/a264f8d54fade3a4ecbcfd4915ba29b2a388b31e) Test case for user info override fix - [`ac9664c`](https://github.com/better-auth/better-auth/commit/ac9664c3b26449d2da631327b5ff8aeabe16e7ed) Use cookieCache instead of secondaryStorage in test ### 📊 Changes **2 files changed** (+105 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/oauth2/link-account.test.ts` (+104 -1) 📝 `packages/better-auth/src/oauth2/link-account.ts` (+1 -1) </details> ### 📄 Description When `overrideUserInfo` is enabled, `updateUser()` was called but its return value wasn't captured, causing sessions to be created with stale user data instead of the updated information from the OAuth provider. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixed OAuth sessions using stale user data when overrideUserInfo is enabled. We now assign the result of updateUser to the user object so sessions reflect provider updates on sign-in and account linking. <sup>Written for commit ac9664c3b26449d2da631327b5ff8aeabe16e7ed. 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:32: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#23204