Next.js Discord

Discord Forum

Accessing cookies of incoming requests

Answered
California pilchard posted this in #help-forum
Open in Discord
California pilchardOP
Hello, I have a nextjs 13 application and I want to access cookie that comes with every request. I am not able to figure out how to do that. Help is appreciated

9 Replies

In where? A page/server component, or middleware
California pilchardOP
in the page
Answer
California pilchardOP
my backend is redirecting to a page with cookies (access token set)
will try
I am basically implementing Discord's oauth 2.0
I usually recommend redirect users to an GET Router handler, because you can access cookies easier there
California pilchardOP
thanks