I’m currently migrating from NextAuth to BetterAuth, but I’m running into some problems – especially when it comes to fetching the session server-side in Next.js.
I’ve documented my current setup and my BetterAuth implementation in Notion for reference.
The main issue: • On localhost the SSR session fetch works. • Server-side (deployed) it fails – I get a fetch failed error.
When I tried this about half a year ago with an earlier version, I didn’t get a fetch error, but the session was always null on SSR (while client-side it worked fine).
Now, with the latest BetterAuth version, I consistently get fetch failed on SSR.