GitHub oauth emailVerifyed always false if user profile include email information #431

Closed
opened 2026-03-13 07:45:34 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @DominicTylor on GitHub (Dec 19, 2024).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

When you try to login throw github oauth and user already exist by another login type - you will always see 'account not linked' issue, because in github provider file, it's skip condition to request email list and use default false setting for emailVerified

Screenshot 2024-12-18 at 11 03 27 PM

Current vs. Expected behavior

in case when email exist in profile - it's anyway better request emailList and make sure email is verifiied

What version of Better Auth are you using?

1.0.22

Provide environment information

- OS MacOS 14.6.1
- Any browsers

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
  },
  account: {
      accountLinking: {
          enabled: true,
      },
  },
  socialProviders: {
        github: {
            clientId: process.env.GITHUB_CLIENT_ID!,
            clientSecret: process.env.GITHUB_CLIENT_SECRET!,
        },
        google: {
            clientId: process.env.GOOGLE_CLIENT_ID!,
            clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
        },
   },
});

Additional context

No response

Originally created by @DominicTylor on GitHub (Dec 19, 2024). ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce When you try to login throw github oauth and user already exist by another login type - you will always see 'account not linked' issue, because in github provider file, it's skip condition to request email list and use default `false` setting for emailVerified <img width="584" alt="Screenshot 2024-12-18 at 11 03 27 PM" src="https://github.com/user-attachments/assets/55e888ca-6576-4ef4-9bf3-376f9e6edb87" /> ### Current vs. Expected behavior in case when email exist in profile - it's anyway better request emailList and make sure email is verifiied ### What version of Better Auth are you using? 1.0.22 ### Provide environment information ```bash - OS MacOS 14.6.1 - Any browsers ``` ### 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 }, account: { accountLinking: { enabled: true, }, }, socialProviders: { github: { clientId: process.env.GITHUB_CLIENT_ID!, clientSecret: process.env.GITHUB_CLIENT_SECRET!, }, google: { clientId: process.env.GOOGLE_CLIENT_ID!, clientSecret: process.env.GOOGLE_CLIENT_SECRET!, }, }, }); ``` ### Additional context _No response_
GiteaMirror added the bug label 2026-03-13 07:45:34 -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#431