Socket
Socket
Sign inDemoInstall

express-jwt

Package Overview
Dependencies
Maintainers
4
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-jwt - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

2

lib/index.js

@@ -64,2 +64,4 @@ var jwt = require('jsonwebtoken');

token = credentials;
} else {
return next(new UnauthorizedError('credentials_bad_scheme', { message: 'Format is Authorization: Bearer [token]' }));
}

@@ -66,0 +68,0 @@ } else {

2

package.json
{
"name": "express-jwt",
"version": "1.3.1",
"version": "1.4.0",
"description": "JWT authentication middleware.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -54,2 +54,11 @@ var jwt = require('jsonwebtoken');

it('should throw if authorization header is not Bearer', function() {
req.headers = {};
req.headers.authorization = 'Basic foobar';
expressjwt({secret: 'shhhh'})(req, res, function(err) {
assert.ok(err);
assert.equal(err.code, 'credentials_bad_scheme');
});
});
it('should throw if authorization header is not well-formatted jwt', function() {

@@ -56,0 +65,0 @@ req.headers = {};

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