{"repo":"fastify/fastify-jwt","free":true,"listed":false,"github":"https://github.com/fastify/fastify-jwt","clone":"git clone https://github.com/fastify/fastify-jwt.git","description":"JWT utils for Fastify","language":"JavaScript","stars":584,"topics":["jwt","fastify","fastify-plugin"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"@fastify/jwt JWT utils for Fastify, internally it uses fast-jwt. NOTE: The plugin has been migrated from using jsonwebtoken to fast-jwt . Even though fast-jwt has 1:1 feature implementation with jsonwebtoken , some exotic implementations might break. In that case please open an issue with details of your implementation. See Upgrading notes for more details about what changes this migration introduced. - @fastify/jwt = v9 supports Fastify@5. - @fastify/jwt boolean Promise SignPayloadType Promise where request is a FastifyRequest and decodedToken is the parsed (and verified) token information. Its result should be false or Promise if the token should be rejected or, otherwise, be true or Promise if the token should be accepted and, considering that request.user will be used after that, the return should be decodedToken itself. Example trusted tokens formatUser Example with formatted user You may customize the request.user object setting a custom sync function as parameter: namespace To define multiple JWT validators on the same routes, you may use the namespace option. You can combine this with custom names for jwtVerify , jwtDecode , and jwtSign . When you omit the jwtVerify , jwtDecode , or jwtSign options, the default function name will be JwtVerify , JwtDecode and JwtSign correspondingly. When namespace is used, fastify.jwt stores one JWT utility object per namespace. For example, namespace: 'security' exposes fastify.jwt.security.sign() , fastify.jwt.security.verify() , an","default_branch":null,"files":null,"tree":[],"storefront":"/r/fastify","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/fastify/fastify-jwt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}