You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating an app based on better-auth and nuxt. This example is very handy.
However, I need to use an external server (including for auth), meaning I changed the baseUrl option in better auth client.
Using this repo I get hydration mismatches and empty sessions on server (since it tries to access server session but it is not on the same server).
For now, here are my attemps:
middelware/auth.global.ts
always await fetchSession()
plugins/auth.[env].ts
always fetch, in any circumstances --> does nothing
I am creating an app based on better-auth and nuxt. This example is very handy.
However, I need to use an external server (including for auth), meaning I changed the baseUrl option in better auth client.
Using this repo I get hydration mismatches and empty sessions on server (since it tries to access server session but it is not on the same server).
For now, here are my attemps:
middelware/auth.global.ts
await fetchSession()
plugins/auth.[env].ts
I added this in my middleware:
On client, it successfully gets the session (undefined then defined).
However, on server, it always says session in undefined.
Any idea or similar issues that where solved?
The text was updated successfully, but these errors were encountered: