Open benedictusalvian opened 1 year ago
Hello!
I think the callback url has to be something like https://fyp-omega.vercel.app/api/auth/callback/github.
On the other hand, during deployment, I believe Vercel handles NEXTAUTH_URL for you, so you don't even need to set that one in production.
Best of luck.
I changed my callback URL to the one you mentioned above. Unfortunately, there is still the same error message. Quite puzzling as local is working fine.
Usually when these errors occur, you can check on your Developer Tools the status code, and a more elaborate response of what going on. These I would consider checking:
It happened to me once and Auth.js just would work. I removed my production env variables for NextAuth and let Vercel handle the rest.
I made sure I had the correct setup as Auth.js documents. Github is relatively simple to set up, and Shad already did the heavy lifting here. Remember the S in https for the authorization callback url (happened to me once).
Make sure you're using the right credentials for production, as Github only allows one callback per token, sometimes people confuse them while setting them up for the first time (hello again, also happened to me).
Please, if possible, let us see what the console is telling you, so we can this issue together. 🚀
Hi, I'm getting the same error, and banging my head for the last 3 hours without solving the issue.
Did you maybe solve it?
Solved, it was about this issue #142. The field refresh_token_expires_in in the github account schema was missing.
Hey all, I have set all the env variables, but somehow log in is not working when deployed. Everything works fine locally.
I get this error through the URL: https://fyp-omega.vercel.app/login?callbackUrl=https%3A%2F%2Ffyp-omega.vercel.app%2Flogin&error=Callback
Are you on a test deployment? I believe that vercel generates a unique url for each test deployment.
It seems to work with credentials for me, and then it works in production. It's just the way vercel does it. This is a potential solution https://github.com/orgs/vercel/discussions/132#discussioncomment-4270119
I am also facing same login issue after deploying on vercel but I am using Kinde authentication. My url is https://medicalanddigitalsciences.vercel.app/. Please, suggest any solution?
I am also facing same login issue after deploying on vercel but I am using Kinde authentication. My url is https://medicalanddigitalsciences.vercel.app/. Please, suggest any solution?
Does it work if you use Vercel env variables in your url? https://vercel.com/docs/deployments/generated-urls
Hey all, I have set all the env variables, but somehow log in is not working when deployed. Everything works fine locally.
I get this error through the URL: https://fyp-omega.vercel.app/login?callbackUrl=https%3A%2F%2Ffyp-omega.vercel.app%2Flogin&error=Callback
My deploy URL is https://fyp-omega.vercel.app/
I've set the following env variables in Vercel: NEXT_PUBLIC_APP_URL: https://fyp-omega.vercel.app/ NEXTAUTH_URL: https://fyp-omega.vercel.app/
And I've set GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET from GitHub, and made sure the OAuth Apps app URL and calback URL to be https://fyp-omega.vercel.app/. The GITHUB_ACCESS_TOKEN is there as well.
Everything works locally, just not in deployment.
Any help is appreciated.