hard to debug oauth provider errors during getUserInfo #2115

Open
opened 2026-03-13 09:28:26 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @ping-maxwell on GitHub (Oct 13, 2025).

Originally assigned to: @ping-maxwell on GitHub.

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Making this issue on behalf of a Discord user for the purpose of tracking.
discord message: https://discord.com/channels/1288403910284935179/1288403910284935182/1427311748918284442


User message:

hello everyone!
Today a user reported an error trying to login with GitHub, after a bit of digging we figured it was just a blip from GH itself, however we didn't get any context from bettar-auth as getUserInfo simply returns null in case of error when retrieving a user profile fails: b896e83631/packages/core/src/social-providers/github.ts (L116), which then renders the default error page with unable_to_get_user_info. should any error there be returned as well to get logged in b896e83631/packages/better-auth/src/api/routes/callback.ts (L116) and possibly passed down to the error page?

Image

Current vs. Expected behavior

Improve logging.

What version of Better Auth are you using?

any

System info

.

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @ping-maxwell on GitHub (Oct 13, 2025). Originally assigned to: @ping-maxwell on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Making this issue on behalf of a Discord user for the purpose of tracking. discord message: https://discord.com/channels/1288403910284935179/1288403910284935182/1427311748918284442 --- ### User message: hello everyone! Today a user reported an error trying to login with GitHub, after a bit of digging we figured it was just a blip from GH itself, however we didn't get any context from bettar-auth as getUserInfo simply returns null in case of error when retrieving a user profile fails: https://github.com/better-auth/better-auth/blob/b896e83631f5b633585b993cf9e531f33dc91402/packages/core/src/social-providers/github.ts#L116, which then renders the default error page with unable_to_get_user_info. should any error there be returned as well to get logged in https://github.com/better-auth/better-auth/blob/b896e83631f5b633585b993cf9e531f33dc91402/packages/better-auth/src/api/routes/callback.ts#L116 and possibly passed down to the error page? <img width="607" height="549" alt="Image" src="https://github.com/user-attachments/assets/49ef5c8b-7cf1-44fd-a1fa-bb90ee8b4641" /> ### Current vs. Expected behavior Improve logging. ### What version of Better Auth are you using? any ### System info ```bash . ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the social-provider label 2026-03-13 09:28:26 -05:00
Author
Owner

@ping-maxwell commented on GitHub (Oct 13, 2025):

Made this issue for tracking purposes.
Linear: https://linear.app/better-auth/issue/ENG-338/chore-improve-debugging-experience-during-oauth-unable-to-get-user

@ping-maxwell commented on GitHub (Oct 13, 2025): Made this issue for tracking purposes. Linear: https://linear.app/better-auth/issue/ENG-338/chore-improve-debugging-experience-during-oauth-unable-to-get-user
Author
Owner

@dosubot[bot] commented on GitHub (Jan 12, 2026):

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

Issue Summary:

  • You reported that Better Auth returns null errors without context during OAuth getUserInfo failures.
  • This results in generic error pages that make debugging difficult.
  • You suggested improving error logging by returning and logging detailed errors, especially for providers like GitHub.
  • The issue is currently tracked with a linked Linear task aimed at enhancing the debugging experience.
  • No further comments or updates have been made on this issue.

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, I will automatically close this issue.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jan 12, 2026): Hi, @ping-maxwell. 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 reported that Better Auth returns null errors without context during OAuth getUserInfo failures. - This results in generic error pages that make debugging difficult. - You suggested improving error logging by returning and logging detailed errors, especially for providers like GitHub. - The issue is currently tracked with a linked Linear task aimed at enhancing the debugging experience. - No further comments or updates have been made on this issue. **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, I will automatically close this issue. Thanks 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#2115