nookies icon indicating copy to clipboard operation
nookies copied to clipboard

Support `NextRequest` and `NextResponse`

Open kino-ma opened this issue 3 years ago • 4 comments

In Next.js's middleware (_middleware.js etc.), we use NextRequest and NextResponse as contexts. I want to pass them to nookies.get/set in the same style as others, so I added support for them in parseCookies and setCookie.

Also, I upgraded next version in dependencies so that the TypeScript compiler can refer to NextRequest and NextResponse that are newer features.

By this PR, #507 will be closed.

kino-ma avatar Jan 14 '22 12:01 kino-ma

I almost figured out the implementation myself but then I find out this pull request. Checked the commits and they look logical. I wonder when will it be merged? @maticzav

yfhui avatar Feb 17 '22 08:02 yfhui

It would be great to get a review on this PR? I would love to use the new _middleware feature with Nookies

snaerth avatar Feb 24 '22 20:02 snaerth

Hello all, Any updates on this?, it is quite useful.

tareqlol avatar Apr 26 '22 09:04 tareqlol

@maticzav

snaerth avatar May 24 '22 21:05 snaerth