Middleware invoked on Server components next-auth-v5?
Unanswered
Rex posted this in #help-forum
RexOP
Hi, I'm currently using next-auth-v5 from this repo:
https://github.com/simone-capelli/next-auth-v5-advanced-guide/commits/master/
And when I try to fetch data from client components, everything works perfectly, but when I do that from Server components, the middleware gets invoked and I get redirected, do you know why and how to fix this?
https://github.com/simone-capelli/next-auth-v5-advanced-guide/commits/master/
And when I try to fetch data from client components, everything works perfectly, but when I do that from Server components, the middleware gets invoked and I get redirected, do you know why and how to fix this?
2 Replies
Jersey Wooly
I am facing the same problem. It works fine with the auth part but the moment i want to check session, it is always empty.
@Jersey Wooly I am facing the same problem. It works fine with the auth part but the moment i want to check session, it is always empty.
RexOP
Hi!
I don't remember the exact error but I found that I was missing 'await' when calling in server components.
What's your error?
I don't remember the exact error but I found that I was missing 'await' when calling in server components.
What's your error?