Skip to content

Access NextRequest in middleware? #270

Closed Answered by TheEdoRan
sleeyax asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, currently no way to do it, unfortunately. That's not a limitation of this library, it's a limitation of React Server Actions, they don't expose the underlying POST request, you can only access headers() and cookies() via Next.js exported functions. You'd have to use route handlers if you want to access the request object.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sleeyax
Comment options

Answer selected by sleeyax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants