[GH-ISSUE #952] Upgrading from 1.0.10 to 1.0.22 breaks createAuthClient with token via Github #8517

Closed
opened 2026-04-13 03:36:39 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @natew on GitHub (Dec 19, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/952

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Using the chat app I've been developing:

git clone git@github.com:onejs/one.git
yarn
cd apps/chat

then run in separate tabs:

yarn docker:start:clean
yarn zero
yarn build:tauri
yarn dev

the handoff to tauri breaks, unfortunately on mac you need a "prod-dev" build of tauri that is built and moved into /Applications to test fully.

Current vs. Expected behavior

once you login it hands the session token back to be used like so:

function createAuthClientWithToken(token: string) {
  return createAuthClient({
    fetchOptions: {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    },
  })
}

see 3f7636209b/apps/chat/src/better-auth/authClient.ts/ (L17-L27)

but i've tried using both jwtToken and session token on latest release and it no longer works. the get-session endpoint returns a 200, but the body is just "null" rather than the data.

What version of Better Auth are you using?

1.0.22

Provide environment information

- Mac / Node 22 / One

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 @natew on GitHub (Dec 19, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/952 ### Is this suited for github? - [X] Yes, this is suited for github ### To Reproduce Using the chat app I've been developing: ``` git clone git@github.com:onejs/one.git yarn cd apps/chat ``` then run in separate tabs: ``` yarn docker:start:clean yarn zero yarn build:tauri yarn dev ``` the handoff to tauri breaks, unfortunately on mac you need a "prod-dev" build of tauri that is built and moved into /Applications to test fully. ### Current vs. Expected behavior once you login it hands the session token back to be used like so: ```tsx function createAuthClientWithToken(token: string) { return createAuthClient({ fetchOptions: { headers: { Authorization: `Bearer ${token}`, }, }, }) } ``` see https://github.com/onejs/one/blob/3f7636209b2b732e7f753eb498cc49a71d47f2e6/apps/chat/src/better-auth/authClient.ts/#L17-L27 but i've tried using both jwtToken and session token on latest release and it no longer works. the get-session endpoint returns a 200, but the body is just "null" rather than the data. ### What version of Better Auth are you using? 1.0.22 ### Provide environment information ```bash - Mac / Node 22 / One ``` ### 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_
GiteaMirror added the lockedbug labels 2026-04-13 03:36:39 -05:00
Author
Owner

@Bekacru commented on GitHub (Dec 19, 2024):

could you try 1.0.23-beta.3? We made signatures required at some point to improve security, but it's probably overkill in most cases. It's now configurable, so this should fix the issue.

<!-- gh-comment-id:2554503988 --> @Bekacru commented on GitHub (Dec 19, 2024): could you try `1.0.23-beta.3`? We made signatures required at some point to improve security, but it's probably overkill in most cases. It's now configurable, so this should fix the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8517