Multiple account linking not working for generic oauth2 #1834 #1067

Closed
opened 2026-03-13 08:21:06 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @beermonsterdota on GitHub (Apr 16, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. link first account from generic oauth2
  2. when try to link second, route throws error that account is already linked

Current vs. Expected behavior

After PR https://github.com/better-auth/better-auth/pull/1803 i expected that it will work for custom oauth provider, but it still behaves the same as before PR - you can not link 2nd account

What version of Better Auth are you using?

1.2.7

Provide environment information

- OS: Windows 11
- Node 20.18.3

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

Package, Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  plugins: [
    genericOAuth({
      config: [
        ...
      ],
    })
  ],
  account: {
    accountLinking: {
      enabled: true,
      allowDifferentEmails: true,
    }
  }
});

Additional context

New issue just because i can't reopen already existed one that was closed https://github.com/better-auth/better-auth/issues/1834#issuecomment-2799039611. Unfortunately, this issue still exists

Originally created by @beermonsterdota on GitHub (Apr 16, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. link first account from generic oauth2 2. when try to link second, route throws error that account is already linked ### Current vs. Expected behavior After PR https://github.com/better-auth/better-auth/pull/1803 i expected that it will work for custom oauth provider, but it still behaves the same as before PR - you can not link 2nd account ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash - OS: Windows 11 - Node 20.18.3 ``` ### Which area(s) are affected? (Select all that apply) Package, Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ plugins: [ genericOAuth({ config: [ ... ], }) ], account: { accountLinking: { enabled: true, allowDifferentEmails: true, } } }); ``` ### Additional context New issue just because i can't reopen already existed one that was closed https://github.com/better-auth/better-auth/issues/1834#issuecomment-2799039611. Unfortunately, this issue still exists
Author
Owner

@guptaashwanee commented on GitHub (Apr 18, 2025):

Did you passed the trusted providers?

@guptaashwanee commented on GitHub (Apr 18, 2025): Did you passed the trusted providers?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1067