fastify-jwt
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -80,3 +80,6 @@ import * as fastify from 'fastify' | ||
} | ||
secret: jwt.Secret | ||
cookie?: { | ||
cookieName: string, | ||
signed: boolean | ||
} | ||
@@ -83,0 +86,0 @@ sign(payload: SignPayloadType, options?: jwt.SignOptions): string |
@@ -73,2 +73,3 @@ import fastify from 'fastify'; | ||
expectAssignable<Function>(app.jwt.decode) | ||
expectAssignable<FastifyJWTOptions['cookie']>(app.jwt.cookie) | ||
@@ -75,0 +76,0 @@ app.addHook("preHandler", async (request, reply) => { |
{ | ||
"name": "fastify-jwt", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "JWT utils for Fastify", | ||
@@ -45,5 +45,5 @@ "main": "jwt.js", | ||
"tap": "^15.0.0", | ||
"tsd": "^0.15.0", | ||
"tsd": "^0.17.0", | ||
"typescript": "^4.0.2" | ||
} | ||
} |
@@ -332,3 +332,3 @@ # fastify-jwt | ||
return { | ||
departmentName: user.department_name | ||
departmentName: user.department_name, | ||
name: user.name | ||
@@ -335,0 +335,0 @@ } |
@@ -20,6 +20,12 @@ 'use strict' | ||
t.test('Expose jwt methods', function (t) { | ||
t.plan(6) | ||
t.plan(7) | ||
const fastify = Fastify() | ||
fastify.register(jwt, { secret: 'test' }) | ||
fastify.register(jwt, { | ||
secret: 'test', | ||
cookie: { | ||
cookieName: 'token', | ||
signed: false | ||
} | ||
}) | ||
@@ -36,2 +42,3 @@ fastify.get('/methods', function (request, reply) { | ||
t.ok(fastify.jwt.verify) | ||
t.ok(fastify.jwt.cookie) | ||
}) | ||
@@ -38,0 +45,0 @@ |
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
106909
2417