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

express-jwt

Package Overview
Dependencies
Maintainers
5
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 3.3.0 to 3.4.0

LICENSE

4

lib/index.js

@@ -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.
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