[GH-ISSUE #8742] [Bug] account.accountLinking.updateUserInfoOnLink doesn't work #28501

Open
opened 2026-04-17 19:57:10 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @mintydev789 on GitHub (Mar 23, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/8742

Originally assigned to: @bytaesu on GitHub.

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

I'm using the following setup (I use the Drizzle adapter btw):

// auth.ts

export const auth = betterAuth({
  // ...
  plugins: [
    genericOAuth({
      config: [
        {
          providerId: "id",
          clientId: "...",
          clientSecret: "...",
          discoveryUrl: "https://example.com",
          scopes: ["public", "openid", "email"],
        },
      ],
    }),
  ],
  account: {
    accountLinking: {
      updateUserInfoOnLink: true,
    },
  },
});

I then try to link my account like this:

      const { data, error } = await authClient.oauth2.link({
        providerId: "id",
        callbackURL: "/user/settings?successful-link=true",
      });

Current vs. Expected behavior

After I successfully link my account (and I can see it's linking in the accounts table), nothing changes in the user. I would expect the linked account to update the name and image columns, overwriting the name I have in my existing user and setting the image, which is null to begin with. I can see those columns being set correctly when I simply sign in using SSO without account linking.

What version of Better Auth are you using?

1.5.5

System info

That doesn't work for projects that use PNPM

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

Backend

Auth config (if applicable)

I can share the full config if needed, but I think what I shared above are the only relevant parts.

Additional context

No response

Originally created by @mintydev789 on GitHub (Mar 23, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/8742 Originally assigned to: @bytaesu on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce I'm using the following setup (I use the Drizzle adapter btw): ```ts // auth.ts export const auth = betterAuth({ // ... plugins: [ genericOAuth({ config: [ { providerId: "id", clientId: "...", clientSecret: "...", discoveryUrl: "https://example.com", scopes: ["public", "openid", "email"], }, ], }), ], account: { accountLinking: { updateUserInfoOnLink: true, }, }, }); ``` I then try to link my account like this: ```ts const { data, error } = await authClient.oauth2.link({ providerId: "id", callbackURL: "/user/settings?successful-link=true", }); ``` ### Current vs. Expected behavior After I successfully link my account (and I can see it's linking in the accounts table), nothing changes in the user. I would expect the linked account to update the name and image columns, overwriting the name I have in my existing user and setting the image, which is null to begin with. I can see those columns being set correctly when I simply sign in using SSO without account linking. ### What version of Better Auth are you using? 1.5.5 ### System info ```bash That doesn't work for projects that use PNPM ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript I can share the full config if needed, but I think what I shared above are the only relevant parts. ``` ### Additional context _No response_
GiteaMirror added the oauthbug labels 2026-04-17 19:57:10 -05:00
Author
Owner

@bytaesu commented on GitHub (Mar 24, 2026):

Let me check 🧐

<!-- gh-comment-id:4118788052 --> @bytaesu commented on GitHub (Mar 24, 2026): Let me check 🧐
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#28501