[1.2.0] user is undefined in session for better-auth/vue client #774

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

Originally created by @Q16solver on GitHub (Mar 4, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

After upgrading to 1.2.0, using the authClient from https://github.com/Esposter/Esposter/blob/main/packages/app/app/services/auth/authClient.ts
via session.value?.user[property] now gives me an reading [property] of undefined on the user rather than the session.value for unauthed users

example usage: https://github.com/Esposter/Esposter/blob/main/packages/app/app/components/Post/Card.vue#L18

Current vs. Expected behavior

undefined should be on session.value rather than on the user when unauthorized, to follow the types as well

What version of Better Auth are you using?

1.2.0

Provide environment information

-

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 @Q16solver on GitHub (Mar 4, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce After upgrading to 1.2.0, using the authClient from https://github.com/Esposter/Esposter/blob/main/packages/app/app/services/auth/authClient.ts via `session.value?.user[property]` now gives me an `reading [property] of undefined` on the user rather than the session.value for unauthed users example usage: https://github.com/Esposter/Esposter/blob/main/packages/app/app/components/Post/Card.vue#L18 ### Current vs. Expected behavior `undefined` should be on session.value rather than on the user when unauthorized, to follow the types as well ### What version of Better Auth are you using? 1.2.0 ### Provide environment information ```bash - ``` ### 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 bug label 2026-03-13 08:03:46 -05:00
Author
Owner

@Q16solver commented on GitHub (May 21, 2025):

Seems to work as of 1.2.8

@Q16solver commented on GitHub (May 21, 2025): Seems to work as of 1.2.8
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#774