express-jwt
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -8,2 +8,7 @@ var jwt = require('jsonwebtoken'); | ||
var getClass = {}.toString; | ||
function isFunction(object) { | ||
return object && getClass.call(object) == '[object Function]'; | ||
} | ||
function wrapStaticSecretInCallback(secret){ | ||
@@ -20,3 +25,3 @@ return function(_, __, cb){ | ||
if (typeof secretCallback === 'string'){ | ||
if (!isFunction(secretCallback)){ | ||
secretCallback = wrapStaticSecretInCallback(secretCallback); | ||
@@ -23,0 +28,0 @@ } |
{ | ||
"name": "express-jwt", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "JWT authentication middleware.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -186,21 +186,7 @@ # express-jwt | ||
## Credits | ||
## Contributors | ||
Check them our [here](https://github.com/auth0/express-jwt/graphs/contributors) | ||
- @jfromaniello ([20 contributions](https://github.com/auth0/express-jwt/commits?author=jfromaniello)) | ||
- @woloski ([16 contributions](https://github.com/auth0/express-jwt/commits?author=woloski)) | ||
- @aaronogle ([3 contributions](https://github.com/auth0/express-jwt/commits?author=aaronogle)) | ||
- @mck- ([3 contributions](https://github.com/auth0/express-jwt/commits?author=mck-)) | ||
- @CLevasseur ([2 contributions](https://github.com/auth0/express-jwt/commits?author=CLevasseur)) | ||
- @wiherek5 ([1 contributions](https://github.com/auth0/express-jwt/commits?author=wiherek5)) | ||
- @davis ([1 contributions](https://github.com/auth0/express-jwt/commits?author=davis)) | ||
- @godeatgod ([1 contributions](https://github.com/auth0/express-jwt/commits?author=godeatgod)) | ||
- @nkcmr ([1 contributions](https://github.com/auth0/express-jwt/commits?author=nkcmr)) | ||
- @philosoralphter ([1 contributions](https://github.com/auth0/express-jwt/commits?author=philosoralphter)) | ||
- @iamsebastian ([1 contributions](https://github.com/auth0/express-jwt/commits?author=iamsebastian)) | ||
- @tonytamps ([1 contributions](https://github.com/auth0/express-jwt/commits?author=tonytamps)) | ||
- @dannyrscott ([1 contributions](https://github.com/auth0/express-jwt/commits?author=dannyrscott)) | ||
- @dschenkelman ([1 contributions](https://github.com/auth0/express-jwt/commits?author=dschenkelman)) | ||
## License | ||
This project is licensed under the MIT license. See the [LICENSE](LICENSE.txt) file for more info. |
@@ -180,2 +180,13 @@ var jwt = require('jsonwebtoken'); | ||
it('should work if authorization header is valid with a buffer secret', function() { | ||
var secret = new Buffer('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'base64'); | ||
var token = jwt.sign({foo: 'bar'}, secret); | ||
req.headers = {}; | ||
req.headers.authorization = 'Bearer ' + token; | ||
expressjwt({secret: secret})(req, res, function() { | ||
assert.equal('bar', req.user.foo); | ||
}); | ||
}); | ||
it('should set userProperty if option provided', function() { | ||
@@ -182,0 +193,0 @@ var secret = 'shhhhhh'; |
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
436
24336
192