[GH-ISSUE #1363] Expose oauth payload like access tokens in the mapProdileToUser social callback #17341

Closed
opened 2026-04-15 15:27:49 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @tigawanna on GitHub (Feb 5, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1363

Is this suited for github?

  • Yes, this is suited for github

Describe the solution you'd like

Expose oauth payload like access tokens in the mapProdileToUser social callback to allow us to save auch payloads and have it be available to the user session payload sent to the client

Example use is getting the GitHub access token and use it to hit their api from the client

Describe alternatives you've considered

Creating an endpoint to get it from the accounts table

Additional context

No response

Originally created by @tigawanna on GitHub (Feb 5, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1363 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. ### Describe the solution you'd like Expose oauth payload like access tokens in the mapProdileToUser social callback to allow us to save auch payloads and have it be available to the user session payload sent to the client Example use is getting the GitHub access token and use it to hit their api from the client ### Describe alternatives you've considered Creating an endpoint to get it from the accounts table ### Additional context _No response_
GiteaMirror added the locked label 2026-04-15 15:27:49 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 14, 2025):

Hi, @tigawanna. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • Feature request to expose OAuth payloads in mapProfileToUser callback.
  • Purpose is to save payloads for client session use, e.g., GitHub API interactions.
  • Alternative approach: endpoint to retrieve token from accounts table.
  • No comments or activity since the issue was opened.

Next Steps

  • Please confirm if this issue is still relevant to the latest version of better-auth by commenting here.
  • If no updates are provided, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2972847735 --> @dosubot[bot] commented on GitHub (Jun 14, 2025): Hi, @tigawanna. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary** - Feature request to expose OAuth payloads in `mapProfileToUser` callback. - Purpose is to save payloads for client session use, e.g., GitHub API interactions. - Alternative approach: endpoint to retrieve token from accounts table. - No comments or activity since the issue was opened. **Next Steps** - Please confirm if this issue is still relevant to the latest version of better-auth by commenting here. - If no updates are provided, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@tigawanna commented on GitHub (Jun 14, 2025):

Yes it's still relevant, there's a project that we had to move to employ hacks to work around this limitation

<!-- gh-comment-id:2972893307 --> @tigawanna commented on GitHub (Jun 14, 2025): Yes it's still relevant, there's a project that we had to move to employ hacks to work around this limitation
Author
Owner

@dosubot[bot] commented on GitHub (Sep 13, 2025):

Hi, @tigawanna. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested that the OAuth payload, including access tokens, be exposed in the mapProfileToUser social callback.
  • This feature would allow saving tokens for client-side API calls without needing extra endpoints.
  • You confirmed the issue remains relevant and shared that you had to implement workarounds due to this limitation.
  • The issue is currently unresolved and awaiting further updates or action.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I don’t hear back within 7 days, the issue will be automatically closed.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3288576099 --> @dosubot[bot] commented on GitHub (Sep 13, 2025): Hi, @tigawanna. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested that the OAuth payload, including access tokens, be exposed in the `mapProfileToUser` social callback. - This feature would allow saving tokens for client-side API calls without needing extra endpoints. - You confirmed the issue remains relevant and shared that you had to implement workarounds due to this limitation. - The issue is currently unresolved and awaiting further updates or action. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I don’t hear back within 7 days, the issue will be automatically closed. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#17341