Skip to content

Commit ecdba8d

Browse files
authored
Merge pull request #523 from WilliamEspegren/patch-1
docs: Fix JWT payload format in documentation: "name" → { name }
2 parents c46ecc9 + 329a817 commit ecdba8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/plugins/jwt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const app = new Elysia()
3838
})
3939
)
4040
.get('/sign/:name', async ({ jwt, params: { name }, cookie: { auth } }) => {
41-
const value = await jwt.sign(name)
41+
const value = await jwt.sign({ name })
4242

4343
auth.set({
4444
value,
@@ -72,7 +72,7 @@ const app = new Elysia()
7272
})
7373
)
7474
.get('/sign/:name', ({ jwt, params: { name } }) => {
75-
return jwt.sign(name)
75+
return jwt.sign({ name })
7676
})
7777
.get('/profile', async ({ jwt, error, headers: { authorization } }) => {
7878
const profile = await jwt.verify(authorization)

0 commit comments

Comments
 (0)