OAuth tokens not set on account created by manual linking #683

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

Originally created by @thiagofelix on GitHub (Feb 16, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

When doing manual linking the OAuth account tokens (access token and refresh tokens) are not set in the accounts table.

Is this intentional? Or perhaps a bug/missing feature?

Current vs. Expected behavior

Current

Manually linked accounts don't have OAuth tokens stored

Expected

OAuth tokens to be stored after manually linking same as it does with regular OAuth login

What version of Better Auth are you using?

1.x.x

Provide environment information

- MacOS

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

Backend

Auth config (if applicable)

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

Additional context

FWIW the "issue" is because /callback api route doesn't forward the tokens during linking the same way it does during regular signin process

Originally created by @thiagofelix on GitHub (Feb 16, 2025). ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce When doing [manual linking](https://www.better-auth.com/docs/concepts/users-accounts#manually-linking-accounts) the OAuth account tokens (access token and refresh tokens) are not set in the `accounts` table. Is this intentional? Or perhaps a bug/missing feature? ### Current vs. Expected behavior ### Current Manually linked accounts don't have OAuth tokens stored ### Expected OAuth tokens to be stored after manually linking same as it does with regular OAuth login ### What version of Better Auth are you using? 1.x.x ### Provide environment information ```bash - MacOS ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ account: { accountLinking: { enabled: true, allowDifferentEmails: true, }, }, }); ``` ### Additional context FWIW the "issue" is because `/callback` api route [doesn't forward the tokens](https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/api/routes/callback.ts#L134) during linking the same way it [does during regular signin process](https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/api/routes/callback.ts#L152)
GiteaMirror added the bug label 2026-03-13 08:00:17 -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#683