Next.js Discord

Discord Forum

getting cookies not working

Unanswered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
Hello all, I am trying to do following, since using next-auth, i want to sign out the user from a fetch interceptor, however this does not work, so I am trying to do the following, which is create a route like this api/logout/route.ts and in there trying to delete all the cookies related to next-auth and redirect the user to login page, however there are a few issues with this, the biggest one is not being able to get the cookies , using next/headers or also nextRequest and then of course the cookies aren't being deleted, currently this is what i have. Any Ideas why this might be happening or hwo to fix this

0 Replies