[GH-ISSUE #8345] accountInfo endpoint not working in 1.5.x #11062

Closed
opened 2026-04-13 07:26:30 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @NathanColosimo on GitHub (Mar 3, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/8345

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Calling authClient.accountInfo(account.accountId); does not work in 1.5.x, while it did work in 1.4.x.

This has to do with PR #7216- https://github.com/better-auth/better-auth/pull/7216 - looks like this fix fixed the getAccessToken endpoint, but did not also fix the accountInfo endpoint.

in packages/better-auth/src/api/routes/accounts.ts on line 910 we call getAccessToken with accountId: account.id when it should be account.accountId

I'll open up a PR today to fix

Current vs. Expected behavior

I called the accountInfo endpoint from the frontend, and used accountId

What version of Better Auth are you using?

1.5.2

System info

bunx auth info --json    
{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 25.3.0: Wed Jan 28 20:53:05 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6020",
    "release": "25.3.0",
    "cpuCount": 12,
    "cpuModel": "Apple M2 Pro",
    "totalMemory": "16.00 GB",
    "freeMemory": "0.32 GB"
  },
  "node": {
    "version": "v25.7.0",
    "env": "development"
  },
  "packageManager": {
    "name": "bun",
    "version": "1.3.10"
  },
  "frameworks": null,
  "databases": null,
  "betterAuth": {
    "version": "catalog:",
    "config": null
  }
}

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

Client

Auth config (if applicable)

export const auth = betterAuth({
  baseURL: env.NEXT_PUBLIC_WEB_URL,
  advanced: {
    // Prefix Better Auth cookies for Kompose.
    cookiePrefix: "kompose",
  },
  database: drizzleAdapter(db, {
    provider: "pg",
    schema,
  }),
  /** Redis-backed storage for sessions and rate limit counters. */
  secondaryStorage: redisSecondaryStorage,
  /** Rate limiting for auth endpoints (sign-in, token refresh, etc.). */
  rateLimit: {
    enabled: true,
    window: 60,
    max: 100,
    storage: "secondary-storage",
  },
  trustedOrigins: [
    env.NEXT_PUBLIC_WEB_URL,
    "kompose://",
    "exp://",
    "http://localhost:3000",
    "tauri://localhost",
    "https://appleid.apple.com",
  ],
  emailAndPassword: {
    enabled: false,
  },
  account: {
    accountLinking: {
      enabled: true,
      // Support linking additional Google accounts that may use different emails.
      allowDifferentEmails: true,
      trustedProviders: ["google", "apple"],
    },
  },
  socialProviders: {
    google: {
      prompt: "select_account consent",
      accessType: "offline",
      clientId: env.GOOGLE_CLIENT_ID,
      clientSecret: env.GOOGLE_CLIENT_SECRET,
      scope: ["https://www.googleapis.com/auth/calendar"],
    },
    apple: {
      clientId: env.APPLE_CLIENT_ID,
      clientSecret: env.APPLE_CLIENT_SECRET,
      appBundleIdentifier: env.APPLE_APP_BUNDLE_IDENTIFIER,
    },
  },
  logger: {
    level: "warn",
  },
  plugins: [
    expo(),
    nextCookies(),
    lastLoginMethod({
      cookieName: "kompose.last_used_login_method",
      storeInDatabase: false,
    }),
    // Bearer token auth for Tauri desktop. The Tauri webview cannot use
    // cookies cross-origin (WKWebView ITP blocks Set-Cookie), so it
    // authenticates via Authorization header instead.
    bearer({ requireSignature: true }),
    // One-time tokens for cross-context auth (Tauri deep-link OAuth flow).
    oneTimeToken({
      storeToken: "hashed",
    }),
  ],
});

Additional context

No response

Originally created by @NathanColosimo on GitHub (Mar 3, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/8345 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Calling ```authClient.accountInfo(account.accountId);``` does not work in 1.5.x, while it did work in 1.4.x. This has to do with PR #7216- https://github.com/better-auth/better-auth/pull/7216 - looks like this fix fixed the getAccessToken endpoint, but did not also fix the accountInfo endpoint. in packages/better-auth/src/api/routes/accounts.ts on line 910 we call getAccessToken with accountId: account.id when it should be account.accountId I'll open up a PR today to fix ### Current vs. Expected behavior I called the accountInfo endpoint from the frontend, and used accountId ### What version of Better Auth are you using? 1.5.2 ### System info ```bash bunx auth info --json { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 25.3.0: Wed Jan 28 20:53:05 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6020", "release": "25.3.0", "cpuCount": 12, "cpuModel": "Apple M2 Pro", "totalMemory": "16.00 GB", "freeMemory": "0.32 GB" }, "node": { "version": "v25.7.0", "env": "development" }, "packageManager": { "name": "bun", "version": "1.3.10" }, "frameworks": null, "databases": null, "betterAuth": { "version": "catalog:", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript export const auth = betterAuth({ baseURL: env.NEXT_PUBLIC_WEB_URL, advanced: { // Prefix Better Auth cookies for Kompose. cookiePrefix: "kompose", }, database: drizzleAdapter(db, { provider: "pg", schema, }), /** Redis-backed storage for sessions and rate limit counters. */ secondaryStorage: redisSecondaryStorage, /** Rate limiting for auth endpoints (sign-in, token refresh, etc.). */ rateLimit: { enabled: true, window: 60, max: 100, storage: "secondary-storage", }, trustedOrigins: [ env.NEXT_PUBLIC_WEB_URL, "kompose://", "exp://", "http://localhost:3000", "tauri://localhost", "https://appleid.apple.com", ], emailAndPassword: { enabled: false, }, account: { accountLinking: { enabled: true, // Support linking additional Google accounts that may use different emails. allowDifferentEmails: true, trustedProviders: ["google", "apple"], }, }, socialProviders: { google: { prompt: "select_account consent", accessType: "offline", clientId: env.GOOGLE_CLIENT_ID, clientSecret: env.GOOGLE_CLIENT_SECRET, scope: ["https://www.googleapis.com/auth/calendar"], }, apple: { clientId: env.APPLE_CLIENT_ID, clientSecret: env.APPLE_CLIENT_SECRET, appBundleIdentifier: env.APPLE_APP_BUNDLE_IDENTIFIER, }, }, logger: { level: "warn", }, plugins: [ expo(), nextCookies(), lastLoginMethod({ cookieName: "kompose.last_used_login_method", storeInDatabase: false, }), // Bearer token auth for Tauri desktop. The Tauri webview cannot use // cookies cross-origin (WKWebView ITP blocks Set-Cookie), so it // authenticates via Authorization header instead. bearer({ requireSignature: true }), // One-time tokens for cross-context auth (Tauri deep-link OAuth flow). oneTimeToken({ storeToken: "hashed", }), ], }); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 07:26:30 -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#11062