Socket
Socket
Sign inDemoInstall

@fastify/jwt

Package Overview
Dependencies
5
Maintainers
20
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.2.2 to 7.2.3

3

package.json
{
"name": "@fastify/jwt",
"version": "7.2.2",
"version": "7.2.3",
"description": "JWT utils for Fastify",
"main": "jwt.js",
"type": "commonjs",
"types": "types/jwt.d.ts",

@@ -7,0 +8,0 @@ "scripts": {

@@ -279,3 +279,3 @@ # @fastify/jwt

fastify.register(jwt, {
secret: 'foobar'
secret: 'foobar',
cookie: {

@@ -888,2 +888,2 @@ cookieName: 'token',

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

@@ -124,2 +124,3 @@ import {

notBefore: number | string;
key?: string | Buffer
}

@@ -130,2 +131,3 @@

onlyCookie: boolean;
key?: string | Buffer
}

@@ -132,0 +134,0 @@

import fastify from 'fastify';
import fastifyJwt, { FastifyJWTOptions, FastifyJwtNamespace, JWT } from '..'
import fastifyJwt, { FastifyJWTOptions, FastifyJwtNamespace, JWT, SignOptions, VerifyOptions } from '..'
import { expectAssignable, expectType } from 'tsd'

@@ -169,1 +169,37 @@

expectType<JWT['verify']>(({} as FastifyJwtNamespace<{ jwtVerify: 'verify'}>).verify)
let signOptions: SignOptions = {
key: "supersecret",
algorithm: "HS256",
mutatePayload: true,
expiresIn: 3600,
notBefore: 0,
}
signOptions = {
key: Buffer.from("supersecret", "utf-8"),
algorithm: "HS256",
mutatePayload: true,
expiresIn: 3600,
notBefore: 0,
}
let verifyOptions: VerifyOptions = {
key: "supersecret",
algorithms: ["HS256"],
complete: true,
cache: true,
cacheTTL: 3600,
maxAge: "1 hour",
onlyCookie: false,
}
verifyOptions = {
key: Buffer.from("supersecret", "utf-8"),
algorithms: ["HS256"],
complete: true,
cache: 3600,
cacheTTL: 3600,
maxAge: 3600,
onlyCookie: true,
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc