I am aware that this does not seem sound, especially given that NextAuth is supposed to provide client-side authentication.
But I'm in a situation where I am required to test a repo with NextAuth, but I can't migrate my original code yet. This results in the workflow to separate the code into repos for client and server, yet still using NextAuth on both repos.
I am currently trying to implement the signIn() method in the client side and get the credentials from the server side, but the signIn flow is always trying to access the api from the same domain where the signIn() method launches.
ie. Client is on http://localhost:3010 and I expect it to connect to http://localhost:3000/api/auth/ but instead it attempts to connect to http://localhost:3010/api/auth/.
I saw that I can configure environment variables to specify different routes such as NEXTAUTH_URL and NEXTAUTH_URL_INTERNAL but I'm unsure if these modify the parameters I need to make it work how I need it to work...