How to setup BetterAuth with Electron React Frontend and Express backend

Hello everyone!

I'd like to ask how can we get BetterAuth to work with React frontend and Express backend while being in Electron...

For instance, I have many issues like:
  • As I execute signIn function on my frontend, I get redirected to the server social sign in page, which after sign in keeps me right there on server. Redirect url such as / redirects me to / of the webserver, leaving electron trapped on the Express API pages instead of actual React frontend
  • I can solve it by making a plugin which would redirect back to the frontend of Electron (app://-/ or localhost:3000), but as I get back, useSession still doesn't seem to have any available sessions...
What can I do to workaround these issues and get betterauth working on Electron?

Thanks
Was this page helpful?