Replies: 21 comments 38 replies
-
I am having the same problem. Works fine on development. Keep redirecting me back to import NextAuth from "next-auth";
import Providers from "next-auth/providers";
import * as Fauna from "faunadb";
import { FaunaAdapter } from "@next-auth/fauna-adapter";
const client = new Fauna.Client({
secret: process.env.FAUNA_SECRET,
});
export default NextAuth({
providers: [
Providers.Email({
server: process.env.EMAIL_SERVER,
from: process.env.EMAIL_FROM,
}),
Providers.GitHub({
clientId: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
}),
],
adapter: FaunaAdapter({ faunaClient: client })
}); |
Beta Was this translation helpful? Give feedback.
-
Do you have cookies disabled by chance? Can you also show the client code you use to sign the user in? |
Beta Was this translation helpful? Give feedback.
-
There must be a configuration error somewhere, especially when you claim it's almost identical to the example repo. You can see a live demo here: https://next-auth-example.vercel.app/ Will make sure to add a dummy credentials provider as well, but I am pretty sure it's not the root cause of the problem. Do you set |
Beta Was this translation helpful? Give feedback.
-
Antivirus on my laptop was blocking the request. It worked after adding the URL as an exception in Bitdefender. |
Beta Was this translation helpful? Give feedback.
-
I'm having the same problem, specifically with the Fauna adapter. Without using the Fauna adapter, I'm having no problems with the credentials provider. As soon as I add the Fauna adapter, however, this issue occurs. Not exactly sure what the problem is yet, but I switched to using Auth0 as a provider for now and that worked perfectly once I got all the Auth0 configuration down. So I'm inclined to believe it's something with the way I had the credential provider configured (perhaps with the data I'm returning in the |
Beta Was this translation helpful? Give feedback.
-
I am also getting this issue - no antivirus |
Beta Was this translation helpful? Give feedback.
-
in my case, I accidentally called getCsrfToken method on getServerSideProps so it might be make next-auth failed to validate the CSRF token. So I comment it, and now everything works as expected 🎉 |
Beta Was this translation helpful? Give feedback.
-
This is an issue for me too. Works fine locally, but when I deploy it as an Outlook add-in it redirects me to the same url as above. I guess I have to use a different provider now |
Beta Was this translation helpful? Give feedback.
-
I have the same problem with my Email yahoo and my domain its works but Hotmail and Gmail doesn't and IDK why |
Beta Was this translation helpful? Give feedback.
-
My issue was resolved by using node v16 instead of 18 |
Beta Was this translation helpful? Give feedback.
-
Experiencing same issue with the Google provider. My When triggering I think the fix to the |
Beta Was this translation helpful? Give feedback.
-
i i upgraded to "next-auth": "^4.18.8", with node version 16 and 18 both, with credentialsProvider, but still not able to resolve, signIn is not moving to callbackUrl after success |
Beta Was this translation helpful? Give feedback.
-
I got nextAuth working on AWS Amplify, but the same solution in an ECS container resolve to [ api/auth/signin?csrf=true ] .env
[...nextauth]
Could be related to AWS ECS cookie policies? |
Beta Was this translation helpful? Give feedback.
-
Ok I finally resolved my issue (CloudFront Lambda + Edge redirecting to localhost). In the older version (don't ask me which), I have
Once I removed |
Beta Was this translation helpful? Give feedback.
-
I hit the same issue. My production application is inside Ariba punchout catalogue iFrame. I set the |
Beta Was this translation helpful? Give feedback.
-
I also have this issue using the app dir of next. I followed this post: But it is always redirecting me |
Beta Was this translation helpful? Give feedback.
-
hey guys There is another case where it is the latest version v4.22.1,but in 996, I didn't have time to test it, my case didn't have any requirements for the version. |
Beta Was this translation helpful? Give feedback.
-
I am seeing this same problem using the auth0 provider in a Lambda (with a standalone build). It works perfectly fine on my local build, but as soon as I deploy it, it starts redirecting back to /api/auth/signin?csrf=true. I just installed nextauth, so I'm not doing anything interesting with it, just a simple provider, SessionProvider and an icon control that prints the name if they are logged in. Works great locally, not so much on AWS. Not sure where to even start looking. |
Beta Was this translation helpful? Give feedback.
-
I had this same problem and isolated it (in my case) to when I was running the project with bunjs. Initially, I only observed the problem when I was running the "standalone" build, as when you run So, in my case there seems to be some incompatibility between bunjs and next-auth. |
Beta Was this translation helpful? Give feedback.
-
I had the same problem and I fixed it by creating a custom login page following this example: I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Hey all, I managed to solve this issue on my end by making sure that the client was sending BOTH the |
Beta Was this translation helpful? Give feedback.
-
Question 💬
I am having issues with getting the Next Auth Exampleto work using a Credentials Provider. I have Strapi as my backend, where the auth is making an API call to Strapi to authenticate to user based on the credentials provided and return the JWT.
This works in locally but when I deploy to Vercel, I am re-routed to the api/auth/signin?csrf=true page.
I've been trying to figure this out for days with no luck. Any help would be appreciated.
I have the example app deployed to vercel here - https://next-auth-example-puce.vercel.app/
Steps
Results
How to reproduce ☕️
Steps
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions