fastify-jwt
Advanced tools
Comparing version 0.9.0 to 0.9.1
@@ -0,0 +0,0 @@ # Certificates generation |
@@ -0,0 +0,0 @@ 'use strict' |
{ | ||
"name": "fastify-jwt", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "JWT utils for Fastify", | ||
@@ -5,0 +5,0 @@ "main": "jwt.js", |
@@ -32,3 +32,3 @@ # fastify-jwt | ||
For verifying & accessing the decoded token inside your services, you can use a global `preHandler` hook to define the verification process like so: | ||
For verifying & accessing the decoded token inside your services, you can use a global `onRequest` hook to define the verification process like so: | ||
@@ -41,3 +41,3 @@ ```js | ||
fastify.addHook("preHandler", async (request, reply) => { | ||
fastify.addHook("onRequest", async (request, reply) => { | ||
try { | ||
@@ -81,3 +81,3 @@ await request.jwtVerify() | ||
Then use the `preHandler` of a route to protect it & access the user information inside: | ||
Then use the `onRequest` of a route to protect it & access the user information inside: | ||
@@ -89,3 +89,3 @@ ```js | ||
{ | ||
preHandler: [fastify.authenticate] | ||
onRequest: [fastify.authenticate] | ||
}, | ||
@@ -92,0 +92,0 @@ async function(request, reply) { |
@@ -0,0 +0,0 @@ 'use strict' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71226