Localhost refuses to connect
I have my Github client id and secret set up as well as the NEXTAUTH_URL. I'm seeing the Github login screen on localhost:3000 and able to click sign in and sign into my Github. However, once Github sign in is completed the whole app just crashes with localhost refusing to connect and the actual process quitting on terminal.
Home page URL in github: http://localhost:3000/ Authorization Callback URL in Github: http://localhost:3000/api/auth/callback/github
Hello. Make sure you have updated Nextjs to the latest version
pnpm i next@latest
which is "next": "14.0.4" in package.json. The canary version that the template suggest downloading causes this issue.
Hello, me I have a problem with connection, how to repair this ?
Hello, me I have a problem with connection, how to repair this ?
same issue
@arthurbret @josh3io make sure you're using pnpm instead of npm and also setting the VERCEL_URL in your .env.local to your real URL. doing both of those fixed it for me.
how do you login locally with github?
how do you login locally with github?
I'm having the same issue, I think. My project runs locally but upon clicking "Login with GitHub" it logs me in but takes me to the HOSTED version on my Vercel account rather than back to my localhost. If I manually navigate back to localhost, I am not authenticated and the sign-in page appears again.
I'm not sure if I need to set the authorization callback URL, and if so, I'm not sure how. The URL in localhost appears to be pointing back to the correct URL: http://localhost:3000/sign-in?callbackUrl=http%3A%2F%2Flocalhost%3A3000%2F
@voltron33 when you say set the VERCEL_URL to your "real" URL which URL do you mean? Localhost or the production Vercel app? As you can see from my comment above, I'm having an issue where regardless of what I've set VERCEL_URL to, the "Login with GitHub" button takes me through the auth process and then redirects me back to the version I have hosted on Vercel. Thank you!
in your .env.local:
AUTH_REDIRECT_PROXY_URL="http://localhost:3000/api/auth"
On Fri, Feb 9, 2024 at 2:59 PM Brandon @.***> wrote:
how do you login locally with github?
I'm having the same issue, I think. My project runs locally but upon clicking "Login with GitHub" it logs me in but takes me to the HOSTED version on my Vercel account rather than back to my localhost. If I manually navigate back to localhost, I am not authenticated and the sign-in page appears again.
I'm not sure if I need to set the authorization callback URL, and if so, I'm not sure how. The URL in localhost appears to be pointing back to the correct URL: http://localhost:3000/sign-in?callbackUrl=http%3A%2F%2Flocalhost%3A3000%2F
— Reply to this email directly, view it on GitHub https://github.com/vercel/ai-chatbot/issues/201#issuecomment-1936713760, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD6KYTWITOALIUFT6S5MZ3YS2S5BAVCNFSM6AAAAABANJQ7Y2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWG4YTGNZWGA . You are receiving this because you were mentioned.Message ID: @.***>
@josh3io thank you! I will try this next.
What ended up working for me was to change the Homepage URL and Authorization callback URL inside GitHub Developer settings for the app to point to my local URLs. Of course this broke the deployed version I have but I couldn't find any way to separate the settings per environment like you can with keys.