From 329a817007025117d18e74b78d7d90e78168b81b Mon Sep 17 00:00:00 2001 From: William Espegren <131612909+WilliamEspegren@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:59:16 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20Fix=20JWT=20payload=20format=20in=20doc?= =?UTF-8?q?umentation:=20"name"=20=E2=86=92=20{=20name=20}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/plugins/jwt.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins/jwt.md b/docs/plugins/jwt.md index 2028026c..94009642 100644 --- a/docs/plugins/jwt.md +++ b/docs/plugins/jwt.md @@ -38,7 +38,7 @@ const app = new Elysia() }) ) .get('/sign/:name', async ({ jwt, params: { name }, cookie: { auth } }) => { - const value = await jwt.sign(name) + const value = await jwt.sign({ name }) auth.set({ value, @@ -72,7 +72,7 @@ const app = new Elysia() }) ) .get('/sign/:name', ({ jwt, params: { name } }) => { - return jwt.sign(name) + return jwt.sign({ name }) }) .get('/profile', async ({ jwt, error, headers: { authorization } }) => { const profile = await jwt.verify(authorization)