Skip to content

Commit

Permalink
Fix onRequest hook documentation (#302)
Browse files Browse the repository at this point in the history
* fix onRequest hook documentation

* post review
  • Loading branch information
mattiapv committed Oct 4, 2023
1 parent 13dcdc4 commit 9509420
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,7 @@ fastify.get('/cookies', async (request, reply) => {
.send({token})
})

fastify.addHook('onRequest', (request) => {
request.jwtVerify()
request.jwtVerify({onlyCookie: true})
})
fastify.addHook('onRequest', (request) => request.jwtVerify({onlyCookie: true}))

fastify.get('/verifycookie', (request, reply) => {
reply.send({ code: 'OK', message: 'it works!' })
Expand Down Expand Up @@ -887,4 +884,4 @@ This project is kindly sponsored by:

## License

Licensed under [MIT](./LICENSE).
Licensed under [MIT](./LICENSE).

0 comments on commit 9509420

Please sign in to comment.