From 17c5f2eeed0d9ce540da2bc8c2785f366cbd8f6b Mon Sep 17 00:00:00 2001 From: Tilo Villwock Date: Fri, 11 Jul 2025 17:00:05 +0200 Subject: [PATCH] Fix README in regard to the cookie plugin --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aa34bee..e8b2173 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ bun add @elysiajs/jwt ```typescript import { Elysia, t } from 'elysia'; import { jwt } from '@elysiajs/jwt'; -import { cookie } from '@elysiajs/cookie'; const app = new Elysia() .use( @@ -23,9 +22,9 @@ const app = new Elysia() secret: 'MY_SECRETS', }) ) - .use(cookie()) - .get('/sign/:name', async ({ jwt, cookie, setCookie, params }) => { - setCookie('auth', await jwt.sign(params), { + .get('/sign/:name', async ({ jwt, cookie: { auth }, params }) => { + auth.set({ + value: await jwt.sign(params), httpOnly: true, });