Socket
Socket
Sign inDemoInstall

@fastify/jwt

Package Overview
Dependencies
Maintainers
19
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/jwt - npm Package Compare versions

Comparing version 6.5.0 to 6.6.0

20

jwt.js

@@ -197,8 +197,22 @@ 'use strict'

let selectedDecoder = decoder
if (options && typeof options !== 'function') {
const localDecoder = createDecoder(options)
return localDecoder(token)
selectedDecoder = createDecoder(options)
}
return decoder(token)
try {
return selectedDecoder(token)
} catch (error) {
// Ignoring the else branch because it's not possible to test it,
// it's just a safeguard for future changes in the fast-jwt library
/* istanbul ignore next */
if (error.code === TokenError.codes.malformed) {
throw new AuthorizationTokenInvalidError(error.message)
} else if (error.code === TokenError.codes.invalidType) {
throw new AuthorizationTokenInvalidError(error.message)
} else {
throw error
}
}
}

@@ -205,0 +219,0 @@

12

package.json
{
"name": "@fastify/jwt",
"version": "6.5.0",
"version": "6.6.0",
"description": "JWT utils for Fastify",

@@ -10,7 +10,7 @@ "main": "jwt.js",

"lint:fix": "standard --fix",
"test": "npm run lint && npm run unit && npm run test:typescript",
"test": "npm run lint && npm run test:unit && npm run test:typescript",
"test:typescript": "tsd",
"unit": "tap -J test/*.test.js",
"unit:report": "npm run unit -- --cov --coverage-report=html",
"unit:verbose": "npm run unit -- -Rspec"
"test:unit": "tap",
"test:unit:report": "tap --cov --coverage-report=html",
"test:unit:verbose": "tap -Rspec"
},

@@ -48,3 +48,3 @@ "repository": {

"tap": "^16.0.0",
"tsd": "^0.24.1"
"tsd": "^0.25.0"
},

@@ -51,0 +51,0 @@ "tsd": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc