Github provider fails when you don't include email #1263

Closed
opened 2026-03-13 08:30:27 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @mwufi on GitHub (May 24, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

If you created a Github app, and don't manually select email scope, you get an error upon signing in!

Image

Fix

To prevent this, we can educate users to add the email scope to their Github app (before copying the client id/secret)

Note that this only applies to Github apps! (https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps)

Oauth apps are fine and work by default.

Current vs. Expected behavior

Current: fails
Expected: Does not fail (after user fix)

What version of Better Auth are you using?

1.2.8

Provide environment information

- OS: Mac OS
- Browser: Chrome

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

Backend, Documentation

Auth config (if applicable)

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

Additional context

No response

Originally created by @mwufi on GitHub (May 24, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce If you created a Github app, and don't manually select email scope, you get an error upon signing in! <img width="837" alt="Image" src="https://github.com/user-attachments/assets/f7db0fa7-8277-4710-adcd-e146dba837a4" /> ## Fix To prevent this, we can educate users to add the email scope to their Github app (before copying the client id/secret) Note that this only applies to Github apps! (https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps) Oauth apps are fine and work by default. ### Current vs. Expected behavior Current: fails Expected: Does not fail (after user fix) ### What version of Better Auth are you using? 1.2.8 ### Provide environment information ```bash - OS: Mac OS - Browser: Chrome ``` ### Which area(s) are affected? (Select all that apply) Backend, Documentation ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1263