[docs] Add clear docs about cross-origin requests and credentials #1286

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

Originally created by @SohelIslamImran on GitHub (May 31, 2025).

I'm using eden from Elysia. I was getting the user session using authClient.getSession(), but when I request a server endpoints to get user data from a database (where we are checking if the user is authenticated or not, using auth.api.getSession({ headers: request.headers }) in a middleware), I was getting Unauthorized request. I found that the cookie is missing when I send a request. I spend hours finding a solution, tweaking the cookie configuration of better-auth, but no luck! Then deep inside, in the documentation of integrating hono client, I found this line!! ))

Image

I think, better-auth should have better, clearer and highlighted documentation regarding this!

Originally created by @SohelIslamImran on GitHub (May 31, 2025). I'm using [eden](https://elysiajs.com/eden/overview.html) from [Elysia](https://elysiajs.com). I was getting the user session using `authClient.getSession()`, but when I request a server endpoints to get user data from a database (where we are checking if the user is authenticated or not, using `auth.api.getSession({ headers: request.headers })` in a middleware), I was getting Unauthorized request. I found that the cookie is missing when I send a request. I spend hours finding a solution, tweaking the cookie configuration of better-auth, but no luck! Then deep inside, in the documentation of integrating hono client, I found this line!! )) <img width="641" alt="Image" src="https://github.com/user-attachments/assets/83866b63-a9ec-428f-955b-c299b78f055d" /> I think, better-auth should have better, clearer and highlighted documentation regarding this!
Author
Owner

@Kinfe123 commented on GitHub (May 31, 2025):

we will consider this.

@Kinfe123 commented on GitHub (May 31, 2025): we will consider this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1286