Next.js Discord

Discord Forum

Token Next Auth null in Middleware

Answered
dilraba posted this in #help-forum
Open in Discord
Avatar
Hello there, I tried using next-auth with role based authentication with next-auth. But I don't know why, token is always null in middleware, even when user is authenticated. When I try useSession in a component, token is not null. any suggestion, to solve this issue?

I use Next 13.4.12, & next-auth 4.20.1
Image
Image
Answered by dilraba
I solved the issue guys, turned out because i change the cookie session name
View full answer

1 Reply

Avatar
I solved the issue guys, turned out because i change the cookie session name
Answer