[GH-ISSUE #1834] Multiple account linking not working for generic oauth2 #8936

Closed
opened 2026-04-13 04:11:06 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @beermonsterdota on GitHub (Mar 15, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1834

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.5-beta.1

Provide environment information

- OS: Windows 11
- Node 20.18.3

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

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

No response

Originally created by @beermonsterdota on GitHub (Mar 15, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1834 ### 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.5-beta.1 ### Provide environment information ```bash - OS: Windows 11 - Node 20.18.3 ``` ### Which area(s) are affected? (Select all that apply) 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 _No response_
GiteaMirror added the lockedbug labels 2026-04-13 04:11:06 -05:00
Author
Owner

@Kinfe123 commented on GitHub (Mar 16, 2025):

the pr introduces a linking on social providers mainly. will look in to your issue

<!-- gh-comment-id:2727473957 --> @Kinfe123 commented on GitHub (Mar 16, 2025): the pr introduces a linking on social providers mainly. will look in to your issue
Author
Owner

@benkingcode commented on GitHub (Mar 21, 2025):

This would be great to have!

<!-- gh-comment-id:2743338022 --> @benkingcode commented on GitHub (Mar 21, 2025): This would be great to have!
Author
Owner

@Bekacru commented on GitHub (Apr 12, 2025):

this should be addressed from 1.2.6-beta.13. feel free to re-open if not.

<!-- gh-comment-id:2799039611 --> @Bekacru commented on GitHub (Apr 12, 2025): this should be addressed from `1.2.6-beta.13`. feel free to re-open if not.
Author
Owner

@beermonsterdota commented on GitHub (Apr 14, 2025):

Still does not work with manual account linking (when user already logged in). Tried both with 1.2.6-beta.13 and 1.2.7

Image

Image

Unfortunatly, i can't reopen issue cuz i dont have permissions to do so @Bekacru

<!-- gh-comment-id:2802544340 --> @beermonsterdota commented on GitHub (Apr 14, 2025): Still does not work with manual account linking (when user already logged in). Tried both with 1.2.6-beta.13 and 1.2.7 ![Image](https://github.com/user-attachments/assets/c0b9dec6-2e79-4bd6-94c9-124e6acfbb83) ![Image](https://github.com/user-attachments/assets/e734b5b6-06fc-4e5e-881b-27f50192faf6) Unfortunatly, i can't reopen issue cuz i dont have permissions to do so @Bekacru
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8936