-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
/api/auth/session returning 404 in getSession #1835
Comments
Nevermind. It worked after restarting my computer, so must have been a stray process. |
@jeremygottfried I got the same exact problem |
I've found the solution myself. |
@sheptang what was your solution? I've run into a similar issue multiple times and still not sure what's causing it. It only happens in development, and works after restarting my computer, so I'm guessing its a stray process or a caching issue. |
Hello, I'm sorry for giving you empty hopes, it was just a reference to how useless and ego-powered StackOverflow is. If you want, check my answers and you'll see what I mean. |
@sheptang you are more than welcome to find an alternative. And you are most welcome to start discussing the things/suggestions in a constructive way in separate issues. What do you actually miss, what is unclear how you could customize, etc? This project is a collaborative effort and we strive to provide what the users need from beginner to advanced usecases. 😊🙏 |
@jeremygottfried you reopened this issue without further reproduction or information, and it sounds like you have a different problem than the original one. If the problem still exists, I kindly ask you to open a new bug report with a minimal reproduction. |
@sheptang (and anyone else) if you are looking for a more flexible alternative, try using |
Olá para contribuir, tive o mesmo problema, porém no meu caso eu estava rodando dois projetos, um em localhost:3000 e um em uma porta aleatória gerada pelo próprio nuxt, então esse projeto com a porta aleatória estava dando problema, tudo por que por padrão ele gerava a requisição para a porta 3000 e ela não existia nesse segundo projeto. |
For @sidebase/nuxt-auth users.
|
I had the same issue, though I'm using the v5 beta as recommended by next.js. It took me a while to figure where the documentation is, because everything I got was outdated (aka wrong, and the error messages not useful at all). I finally got it working by following the documentation of the beta version in the # e.g. in auth.ts, export the handlers too.
export const { auth, signIn, signOut, handlers } = NextAuth({...}) # create app/api/auth/[...nextauth]/route.js where you will export the GET and POST of these handlers
import { handlers } from "@/auth"
export const { GET, POST } = handlers Hope this help save some time... |
Describe the bug
I have been using next-auth without issue for months and it suddenly stopped working today. I haven't changed any configs.
I am able to log in, but
getSession
throws an error. I added some logs within the node module and found that the error is a 404 when trying to fetch/api/auth/session
. However, that endpoint works without issue when I fetch from the browser.Here are my logs with the error. I added some console logs to the internal
_fetchData2
function in the NextAuth client.Here is what the response looks like when I fetch from the browser:
Steps to reproduce
Expected behavior
I expect to be able to get the session.
Additional context
This has been working correctly up until now.
The text was updated successfully, but these errors were encountered: