Why AUTH_URL Is Required in Production for Next Auth (Auth.js v5)
Overview When deploying an application using Next Auth (Auth.js v5) to a Docker container or production environment, the following error occurs with GitHub OAuth authentication if the AUTH_URL environment variable is not configured: Be careful! The redirect_uri is not associated with this application. Development Environment vs Production Environment Development Environment (npm run dev) In the development environment, Next.js automatically detects host information, so configuring AUTH_URL is not required. # This alone works npm run dev Production Environment (Docker / npm run build && npm start) In the production environment, Next Auth cannot automatically detect host information, so configuring AUTH_URL is required. ...

