-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup github login #28
Comments
Get the same issue.
However, the UI is still in logged out mode. When sending a chat message, a 401 error is returned. |
Check if KV datastore are workin, check env of KV. |
How to set the github callback URL? https://example.com/api/auth/callback/github Is that so? |
same to me |
same to me. And I've used the same callback URL - ".../api/auth/callback/github" |
Same here, investigating why that not work on prod. Local works fine. |
same problem +1 |
Same for me |
For some reason, an Openai key in the .env file has been reset. Setting it up again resolved the issue |
I don’t have issue with OpenAI , Th error is with Auth, on Prod not works only locally. |
This happens because the app check Auth before send request. I don’t see my GitHub username after logging. |
I have the same issue :( |
same problem |
+1 same problem on prod deployment, works fine on local |
Could it be this? |
Same issue here, sign-in works fine locally but not in prod on vercel. When signing in it sets the cookie for the session (also tried with Google) but it doesn't sign-in. The edge function returns 200 in the Vercel logs with the callback to the auth endpoint. |
change "example.com" to your app's URL (the one assigned on vercel) |
If you've ever had a place in your code where you made api call to https://localhost:300... (that has to do with github login or any other provider) just change it to https://yourapp'sdeploymentURL... or use nullish coalescing to make calls to both local or deployment URL |
Has someone managed to find a solution for the problem yet? |
Hi folks, NextAuth.js maintainer here. The callback URL for github should be:
Docs: https://authjs.dev/reference/core/providers_github#callback-url (Note, ai-chatbot uses the If this does not work, could someone link to their project? 🙏 Instead of adding "same issue" or "how to fix" comments, consider adding a 👍 to the issue description instead |
@balazsorban44 I faced the same issue. The reproduction steps are:
Repeat the steps above, but for production instead, with instances of Result: Login succeeds, but the login state on the frontend remains unchanged and requests for a login. Chat history button also does not show. |
Thank you @conradkoh, I'll take a look! FYI, I just pushed some updates (#55, #56) to this repo, make sure those are incorporated. |
Thanks for the explanation , I will try it today, I ask my self why it
works correctly locally and on prod not works and don’t see some error on
logs? Did you tested in PROD?
Em ter., 20 de jun. de 2023 às 17:41, Balázs Orbán ***@***.***>
escreveu:
Thank you @conradkoh <https://github.com/conradkoh>, I'll take a look!
FYI, I just pushed some updates (#55
<#55>, #56
<#56>) to this repo, make
sure those are incorporated.
—
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIOGU4SYN46G2XSC7K2XRLXMHAD7ANCNFSM6AAAAAAZKBCXWA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
*Mit freundlichen Grüßen*
*Carlos Ziegler*
*Mobil: 01727572563*
|
Yes, I can reproduce this when deployed. Looking into it right now. |
Same problems, I'm curious about why https://chat.vercel.ai/ works as expect ? maybe it works with vercel provider? |
@wzono It doesn't work with vercel provider as well. It's weird, waiting for developers to solve this problem. I just subscribed Vercel pro plan to deploy this project but it doesn't work now :( |
Looks like Removing it from my app fixed this issue. |
@pomber removing export const runtime = 'edge' in route.ts did not solve it for me. |
gotta say i'm very puzzled that the deployed site works and just forking it and filling in the env vars does not seem to work. what is wrong with my mental model? how could we be struggling so much? serverless was supposed to solve all this |
Wow.
to
fixed it for me. PS: I updated my code with the latest changes too |
@tomas2387 that's interesting. may I know which route you changed the runtime for? Off the top of my head, I'm wondering if it has anything to do with the caching implemented, where perhaps the navigation is getting cached and not invalidated after the login completes. I haven't dug too much into the details of next13 tbh, but just posting this here to seed the idea in case someone more experienced can help validate this. |
The original reproduced issue is mitigated by disabling caching in the middleware. I am still not really sure how the caching can be more granularly disabled for the header, and also the root cause of the issue. The commit that fixes this can be found here. This was inspired by a separate issue raised here in the next-auth library. @balazsorban44 I think you were involved in that issue thread as well, so perhaps you would have a better idea of what's going on under the hood here. On a separate note, I'm not sure if there is a bug somewhere but it seems like using the chat functionality does not require login. Can't tell if it is a bug or intended behavior. imo it's a bug. |
I released a fix, you can run Tested it here: https://ai-chatbot-28-conrad.vercel.app/ Login should work fine there. |
thank you @balazsorban44, updating |
@balazsorban44 signin is working but chat is broken https://www.loom.com/share/68bb20215d3046f8bfa6fb6906f4102f |
I have the same problem logging with github
OAuth GithubLogsCan someone help me, please? |
@swyxio I cannot seem to be able to look at your Loom. @joseluistello There is a link in the error message, you can check it out for more info: https://errors.authjs.dev/#missingsecret (TLDR; create an |
@joseluistello your reproduction repo works for me locally, both dev and buils&start. Sounds like you might have a wrong For anyone else having further issues, please open a new issue with an attached reproduction. You can see a deployed (Vercel) version #28 (comment) with working login/logout, so I need to see your code to make sure you followed the steps #28 (comment) correctly. |
Thanks so much for your help, Orbán, I was able to get the authentication working with github @balazsorban44 💯 |
Works for me too, Thanks |
Edit: It works for me too (on localhost) Second Edit: Production works fine after removing |
yes, I think this can also be explained in the README.md, which is especially useful for beginners. |
Github Auth works perfectly locally, but stops working as soon as I deploy it on Vercel. |
Login in fact doesn't work fine |
How do I setup the github login? I followed the intruction byt when i click login and authorize my github account, the chat UI just regreshes and still shows Login option, when I click Login again, it just refreshes the page.
The text was updated successfully, but these errors were encountered: