mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): use event.node.req
in cookie utility (#20474)
This commit is contained in:
parent
fd281f2d7d
commit
ea1c5b2550
@ -60,7 +60,7 @@ export function useCookie <T = string | null | undefined> (name: string, _opts?:
|
||||
|
||||
function readRawCookies (opts: CookieOptions = {}): Record<string, string> | undefined {
|
||||
if (process.server) {
|
||||
return parse(useRequestEvent()?.req.headers.cookie || '', opts)
|
||||
return parse(useRequestEvent()?.node.req.headers.cookie || '', opts)
|
||||
} else if (process.client) {
|
||||
return parse(document.cookie, opts)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user