getAccessToken endpoitn doesn't work with Generic OAuth provider #1314

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

Originally created by @Dogfalo on GitHub (Jun 5, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Create a generic OAuth provider, e.g. shopify
  2. Authenticate successfully
  3. Try to call getAccessToken from client
authClient.getAccessToken({
    providerId: 'shopify',
  });

Current vs. Expected behavior

Due to this line, this endpoint only works with the official social providers and an error is returned:
91d504d81b/packages/better-auth/src/api/routes/account.ts (L324)

{
    "code": "PROVIDER_SHOPIFY_IS_NOT_SUPPORTED",
    "message": "Provider shopify is not supported."
}

What version of Better Auth are you using?

1.2.8

Provide environment information

- OS: Macos
- Browser: Chrome 136.0.7103.114

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

Backend

Auth config (if applicable)

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

Additional context

No response

Originally created by @Dogfalo on GitHub (Jun 5, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Create a generic OAuth provider, e.g. `shopify` 2. Authenticate successfully 3. Try to call getAccessToken from client ``` authClient.getAccessToken({ providerId: 'shopify', }); ``` ### Current vs. Expected behavior Due to this line, this endpoint only works with the official social providers and an error is returned: https://github.com/better-auth/better-auth/blob/91d504d81bcea52a6785eec02dca1626f2b734e6/packages/better-auth/src/api/routes/account.ts#L324 ```json { "code": "PROVIDER_SHOPIFY_IS_NOT_SUPPORTED", "message": "Provider shopify is not supported." } ``` ### What version of Better Auth are you using? 1.2.8 ### Provide environment information ```bash - OS: Macos - Browser: Chrome 136.0.7103.114 ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
Author
Owner

@monishski commented on GitHub (Jun 5, 2025):

This is related to #2831.. you will have to install one of their latest beta versions e.g. npm i better-auth@1.2.9-beta.9

@monishski commented on GitHub (Jun 5, 2025): This is related to #2831.. you will have to install one of their latest beta versions e.g. `npm i better-auth@1.2.9-beta.9`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1314