express-jwt
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -5,3 +5,3 @@ var jwt = require('jsonwebtoken'); | ||
var async = require('async'); | ||
var _ = require('lodash'); | ||
var set = require('lodash.set'); | ||
@@ -122,3 +122,3 @@ var DEFAULT_REVOKED_FUNCTION = function(_, __, cb) { return cb(null, false); } | ||
if (err) { return next(err); } | ||
_.set(req, _requestProperty, result); | ||
set(req, _requestProperty, result); | ||
next(); | ||
@@ -125,0 +125,0 @@ }); |
{ | ||
"name": "express-jwt", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "JWT authentication middleware.", | ||
@@ -37,6 +37,6 @@ "keywords": [ | ||
"dependencies": { | ||
"async": "^0.9.0", | ||
"async": "^1.5.0", | ||
"express-unless": "^0.3.0", | ||
"jsonwebtoken": "^5.0.0", | ||
"lodash": "~3.10.1" | ||
"lodash.set": "^4.0.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
@@ -29,4 +29,4 @@ # express-jwt | ||
function(req, res) { | ||
if (!req.user.admin) return res.send(401); | ||
res.send(200); | ||
if (!req.user.admin) return res.sendStatus(401); | ||
res.sendStatus(200); | ||
}); | ||
@@ -64,3 +64,3 @@ ``` | ||
```javascript | ||
var publicKey = fs.readFileSync('/pat/to/public.pub'); | ||
var publicKey = fs.readFileSync('/path/to/public.pub'); | ||
jwt({ secret: publicKey }); | ||
@@ -125,4 +125,4 @@ ``` | ||
function(req, res) { | ||
if (!req.user.admin) return res.send(401); | ||
res.send(200); | ||
if (!req.user.admin) return res.sendStatus(401); | ||
res.sendStatus(200); | ||
}); | ||
@@ -156,7 +156,7 @@ ``` | ||
app.get('/protected', | ||
jwt({secret: shhhhhhared-secret, | ||
jwt({secret: 'shhhhhhared-secret', | ||
isRevoked: isRevokedCallback}), | ||
function(req, res) { | ||
if (!req.user.admin) return res.send(401); | ||
res.send(200); | ||
if (!req.user.admin) return res.sendStatus(401); | ||
res.sendStatus(200); | ||
}); | ||
@@ -173,3 +173,3 @@ ``` | ||
if (err.name === 'UnauthorizedError') { | ||
res.send(401, 'invalid token...'); | ||
res.status(401).send('invalid token...'); | ||
} | ||
@@ -191,6 +191,2 @@ }); | ||
## Issue Reporting | ||
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. | ||
## Tests | ||
@@ -204,4 +200,12 @@ | ||
## Issue Reporting | ||
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. | ||
## Author | ||
[Auth0](auth0.com) | ||
## License | ||
This project is licensed under the MIT license. See the [LICENSE](LICENSE.txt) file for more info. | ||
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. |
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
26320
205
+ Addedlodash.set@^4.0.0
+ Addedasync@1.5.2(transitive)
+ Addedlodash.set@4.3.2(transitive)
- Removedlodash@~3.10.1
- Removedasync@0.9.2(transitive)
- Removedlodash@3.10.1(transitive)
Updatedasync@^1.5.0