Authenticate Next.js app against Express backend.
Hi! I'm trying to setup Better-Auth API in my express app and have it linked to my next.js app, so I can make authenticated requests from client and server components.
I got it somehow working but I have my Next.js app with a different url using nginx (local.dev.com), so that way I can test locally Riot Games OAuth.
When I try to log in from localhost it works fine (I can get the session from both client and server components), but when I use the local.dev.com url it doesn't work on server components.
Any help is appreciated. I honestly don't know if it is a good idea to setup authentication like this (a fullstack app with another backend).
This is my config:
I got it somehow working but I have my Next.js app with a different url using nginx (local.dev.com), so that way I can test locally Riot Games OAuth.
When I try to log in from localhost it works fine (I can get the session from both client and server components), but when I use the local.dev.com url it doesn't work on server components.
Any help is appreciated. I honestly don't know if it is a good idea to setup authentication like this (a fullstack app with another backend).
This is my config: