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

express-jwt

Package Overview
Dependencies
Maintainers
1
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 0.1.2 to 0.2.0

8

lib/index.js

@@ -10,3 +10,3 @@ var jwt = require('jsonwebtoken');

if(req.method === 'OPTIONS' && req.headers.hasOwnProperty('access-control-request-headers')) {
if (req.method === 'OPTIONS' && req.headers.hasOwnProperty('access-control-request-headers')) {
if (req.headers['access-control-request-headers'].split(', ').indexOf('authorization') != -1) {

@@ -17,2 +17,8 @@ return next();

if (typeof options.skip !== 'undefined') {
if (options.skip.indexOf(req.url) > -1) {
return next();
}
}
if (req.headers && req.headers.authorization) {

@@ -19,0 +25,0 @@ var parts = req.headers.authorization.split(' ');

2

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

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

@@ -39,2 +39,8 @@ # express-jwt

Optionally you can add paths for the middleware to skip
app.use(jwt({ secret: 'shhhhhhared-secret', skip: ['/token']}));
This is especially useful when applying to multiple routes.
This module also support tokens signed with public/private key pairs. Instead of a secret, you can specify a Buffer with the public key

@@ -41,0 +47,0 @@

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