Getting auth with HTTP GET not supported #3107
-
Whenever I try to access any |
Beta Was this translation helpful? Give feedback.
Replies: 18 comments 66 replies
-
That endpoint does not exist. You can find the existing ones here: https://next-auth.js.org/getting-started/rest-api A reproduction of your code would help resolve your problem. |
Beta Was this translation helpful? Give feedback.
-
It turns out that I just had the [...nextauth].ts file in the root of the API folder and not in the api/auth folder, sorry 😅 |
Beta Was this translation helpful? Give feedback.
-
For anyone else who found themselves here and does have their Make sure the URL you are hitting is correct. I was visiting |
Beta Was this translation helpful? Give feedback.
-
I've got the same issue as above but my |
Beta Was this translation helpful? Give feedback.
-
Using Turbopack will result in the same error |
Beta Was this translation helpful? Give feedback.
-
I've had this suddenly start appearing on my production site with no apparent change on my part. It works locally, and also works on my staging site which has the exact same code as production. I tried the methods above to no avail. Please help! |
Beta Was this translation helpful? Give feedback.
-
I was running into this error in NextJS v13.0.6 until I downgraded next-auth to v4.16.0. After downgrading, I could log in to all the services once again. |
Beta Was this translation helpful? Give feedback.
-
After upgrading to NextJS to v13.1.1 & NextAuth v 4.18.7 I am no longer having this error. I was having problems while on on NextJS v13.0.2 & NextAuth v4.18.4. |
Beta Was this translation helpful? Give feedback.
-
I'm having this issue on Next 13.1.1 and NextAuth 4.21.1. It's a fresh Next app. |
Beta Was this translation helpful? Give feedback.
-
Could someone check this basic setup. Still getting this error on login button click. Setup is done according to official documentation. |
Beta Was this translation helpful? Give feedback.
-
I had this issue when using GitHub for login. My callback URL was |
Beta Was this translation helpful? Give feedback.
-
I'm using credentials provider (JWT + Django). My backend guy changed http -> https which I wasn't aware of. Adding "s" to the URL solved the issue. |
Beta Was this translation helpful? Give feedback.
-
I had this issue while using App Router instead of Pages. The issue turned out to be [...nextAuth] vs [...nextauth], which is boring, |
Beta Was this translation helpful? Give feedback.
-
By paying attention to the folder arrangement, I resolved the error in pages/api/auth/[...nextauth].ts |
Beta Was this translation helpful? Give feedback.
-
If you have correctly set up next: |
Beta Was this translation helpful? Give feedback.
-
In next 13+ app router it can be having NEXTAUTH_URL while using middleware, delete key from .env should help u like in my case |
Beta Was this translation helpful? Give feedback.
-
for anyone who is having the same error make sure that the folder is named [...nextauth] and not [nextauth] this will make sure that anything that comes after "auth" in 'yourUrl/api/auth/*' is routed to this folder and the route handler you defined runs. Spent like 4 hours on this :) |
Beta Was this translation helpful? Give feedback.
-
Its just folder structure issue. I had pages/api/[nextauth].js (which was wrong). I resolved the issue by just changing the folder structure to pages/api/auth/[nextauth].js |
Beta Was this translation helpful? Give feedback.
It turns out that I just had the [...nextauth].ts file in the root of the API folder and not in the api/auth folder, sorry 😅