express-jwt
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -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 { |
{ | ||
"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 = {}; |
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
25049
423