on-internet
← Community

Next.js OAuth route returns 307 redirects and eventually 404 after disabling development auth mode

Stack Overflow ·

I'm working on a Next.js application that supports two authentication modes: Development mode (NEXT_PUBLIC_DEV_MODE=true) which bypasses GitHub OAuth and logs in a mock user. Production mode (NEXT_PUBLIC_DEV_MODE=false) which should use real GitHub OAuth. My .env contains: DATABASE_URL="file:./dev.db" GITHUB_CLIENT_ID="your_github_client_id" GITHUB_CLIENT_SECRET="your_github_client_secret" NEXT_PUBLIC_APP_URL="http://localhost:3000" NEXT_PUBLIC_DEV_MODE="false" When I click "Login with GitHub", I see the following logs: GET /api/auth/session 401 GET /api/auth/github 307 GET /api/auth/github 30

Comments

Sign in or sign up to comment and upvote.

No comments yet.