[PR #5479] [MERGED] fix(generic-oauth): await async mapProfileToUser #14274

Closed
opened 2026-04-13 09:23:20 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5479
Author: @bytaesu
Created: 10/22/2025
Status: Merged
Merged: 11/13/2025
Merged by: @Bekacru

Base: canaryHead: 2025-10-22/fix/generic-oauth-async


📝 Commits (4)

  • f509e36 fix: await async mapProfileToUser
  • 4acff5e test: add test for async mapProfileToUser
  • fe14430 Merge branch 'canary' into 2025-10-22/fix/generic-oauth-async
  • 6ff3da0 fix: broken imports

📊 Changes

2 files changed (+42 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts (+38 -0)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+4 -1)

📄 Description

Added missing await for mapProfileToUser call in getUserInfo method

Used the same syntax as in social providers such as GitLab

Closes https://github.com/better-auth/better-auth/issues/4197


Summary by cubic

Awaited async mapProfileToUser in generic OAuth getUserInfo so async profile mapping runs correctly and custom user fields are included. Prevents missing mapped data and matches behavior of existing social providers.

  • Bug Fixes
    • Await mapProfileToUser() and spread its result into the returned user object; added a test to ensure async custom fields are applied.

Written for commit 6ff3da0e75. 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/5479 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 10/22/2025 **Status:** ✅ Merged **Merged:** 11/13/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `2025-10-22/fix/generic-oauth-async` --- ### 📝 Commits (4) - [`f509e36`](https://github.com/better-auth/better-auth/commit/f509e3659b47fc353b268f4b75f9c0b850c65d7d) fix: await async mapProfileToUser - [`4acff5e`](https://github.com/better-auth/better-auth/commit/4acff5e23e4d4622a2e32150e9b03c570f68ba67) test: add test for async mapProfileToUser - [`fe14430`](https://github.com/better-auth/better-auth/commit/fe14430b910bdd6e7b9d295ab2e300e91dcb4032) Merge branch 'canary' into 2025-10-22/fix/generic-oauth-async - [`6ff3da0`](https://github.com/better-auth/better-auth/commit/6ff3da0e7529261bcba6e26a0a67ec202106200b) fix: broken imports ### 📊 Changes **2 files changed** (+42 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts` (+38 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+4 -1) </details> ### 📄 Description Added missing `await` for `mapProfileToUser` call in `getUserInfo` method Used the same syntax as in social providers such as [GitLab](https://github.com/better-auth/better-auth/blob/canary/packages/core/src/social-providers/gitlab.ts#L137) Closes https://github.com/better-auth/better-auth/issues/4197 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Awaited async mapProfileToUser in generic OAuth getUserInfo so async profile mapping runs correctly and custom user fields are included. Prevents missing mapped data and matches behavior of existing social providers. - **Bug Fixes** - Await mapProfileToUser() and spread its result into the returned user object; added a test to ensure async custom fields are applied. <sup>Written for commit 6ff3da0e7529261bcba6e26a0a67ec202106200b. 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-13 09:23:20 -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#14274