Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastify-jwt

Package Overview
Dependencies
Maintainers
7
Versions
48
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 0.8.1 to 0.9.0

0

certs/readme.md

@@ -0,0 +0,0 @@ # Certificates generation

3

jwt.js

@@ -216,2 +216,5 @@ 'use strict'

}
if (err instanceof jwt.JsonWebTokenError) {
return callback(new Unauthorized('Authorization token is invalid: ' + err.message))
}
callback(err, result)

@@ -218,0 +221,0 @@ })

2

package.json
{
"name": "fastify-jwt",
"version": "0.8.1",
"version": "0.9.0",
"description": "JWT utils for Fastify",

@@ -5,0 +5,0 @@ "main": "jwt.js",

@@ -0,0 +0,0 @@ # fastify-jwt

@@ -7,2 +7,3 @@ 'use strict'

const Fastify = require('fastify')
const rawJwt = require('jsonwebtoken')

@@ -1292,3 +1293,3 @@ const jwt = require('./jwt')

test('errors', function (t) {
t.plan(6)
t.plan(7)

@@ -1411,2 +1412,19 @@ const fastify = Fastify()

t.test('Invalid signature error', function (t) {
t.plan(2)
const invalidSignatureToken = rawJwt.sign({ foo: 'bar' }, Buffer.alloc(64), {})
fastify.inject({
method: 'get',
url: '/verify',
headers: {
authorization: `Bearer ${invalidSignatureToken}`
}
}).then(function (response) {
const error = JSON.parse(response.payload)
t.is(error.message, 'Authorization token is invalid: invalid signature')
t.is(response.statusCode, 401)
})
})
t.test('requestVerify function: steed.waterfall error function loop test', function (t) {

@@ -1433,4 +1451,4 @@ t.plan(3)

const error = JSON.parse(verifyResponse.payload)
t.is(error.message, 'jwt issuer invalid. expected: foo')
t.is(verifyResponse.statusCode, 500)
t.is(error.message, 'Authorization token is invalid: jwt issuer invalid. expected: foo')
t.is(verifyResponse.statusCode, 401)
})

@@ -1437,0 +1455,0 @@ })

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

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