dimsumham
BABetter Auth
•Created by dimsumham on 4/3/2025 in #help
cloudflare error
Hello - I have a sveltekit application which is hosted on cloudflare pages.
I am using google social login, and it works fine in development.
but in prod, it gives me 500 error right after I click on google account
cookies are not set, and I get this in my cloudflare log:
"message": [
"# SERVER_ERROR: ",
"Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance. (I/O type: Writable)"
]
What might be happening? How can I get this working?
30 replies
BABetter Auth
•Created by dimsumham on 3/26/2025 in #help
auth.api.getSession not refreshing session_data cookie
Hi,
I am using better-auth with sveltekit.
My auth.ts has session.cookieCache to true and maxAge of 1 second for testing purposes.
After the better-auth.session_data expires, it clears from my browser, as expected.
In my sveltekit hooks.server.ts, I'm using auth.api.getSession.
this doesn't refresh the session_data cookie. I only see the session_token instead.
If I use authClient.useSession() from client side, it refreshes the cookie. I see both session_token and session_data cookies.
Is this expected behaviour? Does api.getSession not refresh the cookie on purpose?
5 replies
BABetter Auth
•Created by dimsumham on 3/20/2025 in #help
Cross domain cookie / backend behind cf tunnel
Hi everyone,
Does anyone have a setup where the back end is behind a cloudflare tunnel?
I am dealing with a cross domain cookie issue and would love some help on resolving it.
Front end: localhost:5174
Back end: auth.mydomain.com, running Elysia.
Everything works up to the cookie setting. However the domain is always set to my domain.com. as a result I can't use the cookie / call session on the front end.
What would be the best way to resolve this?
Thank you very much in advance.
2 replies