linkSocial idToken supports #500

Closed
opened 2026-03-13 07:50:02 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @reslear on GitHub (Dec 31, 2024).

Is this suited for github?

  • Yes, this is suited for github

linkSocial with idToken supports, and prevent redirect

i have a custom social login for native platforms:

async function signInGoogle() {

  const token = await GoogleLogin.login()
  
  await authClient.signIn.social({
    provider: 'google',
    idToken: {
      token,
    },
  })
}

Describe the solution you'd like

To link my account, I need to do the same thing now, but I can't because there are redirects.

async function linkGoogle() {

  const token = await GoogleLogin.login()
  
  await authClient.signIn.linkSocial({
    provider: 'google',
    
    // not supports 
    idToken: {
      token,
    },
  })
}

Describe alternatives you've considered

Additional context

No response

Originally created by @reslear on GitHub (Dec 31, 2024). ### Is this suited for github? - [X] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. linkSocial with idToken supports, and prevent redirect i have a custom social login for native platforms: ```ts async function signInGoogle() { const token = await GoogleLogin.login() await authClient.signIn.social({ provider: 'google', idToken: { token, }, }) } ``` ### Describe the solution you'd like To link my account, I need to do the same thing now, but I can't because there are redirects. ```ts async function linkGoogle() { const token = await GoogleLogin.login() await authClient.signIn.linkSocial({ provider: 'google', // not supports idToken: { token, }, }) } ``` ### Describe alternatives you've considered - ### Additional context _No response_
Author
Owner

@reslear commented on GitHub (Feb 24, 2025):

hi @Bekacru is ok if i copy/paste this part?

from:

52ed183bdc/packages/better-auth/src/api/routes/sign-in.ts (L166-L243)

between:

52ed183bdc/packages/better-auth/src/api/routes/account.ts (L138-L139)

@reslear commented on GitHub (Feb 24, 2025): hi @Bekacru is ok if i copy/paste this part? from: https://github.com/better-auth/better-auth/blob/52ed183bdca101d9140ed79ec4466f44c26b0e07/packages/better-auth/src/api/routes/sign-in.ts#L166-L243 between: https://github.com/better-auth/better-auth/blob/52ed183bdca101d9140ed79ec4466f44c26b0e07/packages/better-auth/src/api/routes/account.ts#L138-L139
Author
Owner

@dosubot[bot] commented on GitHub (Jun 13, 2025):

Hi, @reslear. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You raised a need for support in linking social accounts using idToken without redirects for native platforms.
  • You provided code examples and noted the limitations of current redirect methods.
  • You asked Bekacru for permission to use specific code segments from the repository to address the issue.
  • The issue remains unresolved, and you are seeking a solution for direct linking using idToken.

Next Steps:

  • Could you confirm if this issue is still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open.
  • If there is no further activity, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jun 13, 2025): Hi, @reslear. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You raised a need for support in linking social accounts using idToken without redirects for native platforms. - You provided code examples and noted the limitations of current redirect methods. - You asked Bekacru for permission to use specific code segments from the repository to address the issue. - The issue remains unresolved, and you are seeking a solution for direct linking using idToken. **Next Steps:** - Could you confirm if this issue is still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open. - If there is no further activity, this issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@reslear commented on GitHub (Jun 13, 2025):

@dosubot
not stale #1830

@reslear commented on GitHub (Jun 13, 2025): @dosubot not stale [#1830](https://github.com/better-auth/better-auth/pull/1830)
Author
Owner

@Bekacru commented on GitHub (Jun 13, 2025):

hi @reslear sorry for the bot :)) will review this PR and merge

@Bekacru commented on GitHub (Jun 13, 2025): hi @reslear sorry for the bot :)) will review this PR and merge
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#500