Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read value from Cookies in Elysia v0.8 #8

Closed
xantiagoma opened this issue Feb 22, 2024 · 0 comments
Closed

Read value from Cookies in Elysia v0.8 #8

xantiagoma opened this issue Feb 22, 2024 · 0 comments

Comments

@xantiagoma
Copy link

Hi,
On the last version of Elysia 0.8 https://elysiajs.com/blog/elysia-08.html

API to retrieve values from a cookie change https://elysiajs.com/patterns/cookie.html#cookie

This change works for me on local:

return ({ set, request, params, store }) => {
to

return ({ request, params, store, cookie }) => {

and

const cookie = set.cookie ? set.cookie[opts.cookieName] : null
if (cookie && cookie.value) {
return cookie.value
}

to

    const _cookie = cookie ? cookie[opts.cookieName] : null;
    if (_cookie && _cookie.value) {
      return _cookie.value;
    }
eelkevdbos added a commit that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants