nookies
nookies copied to clipboard
Support `NextRequest` and `NextResponse`
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.
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
It would be great to get a review on this PR? I would love to use the new _middleware feature with Nookies
Hello all, Any updates on this?, it is quite useful.
@maticzav