express-jwt
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -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(' '); |
{ | ||
"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 @@ |
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
8066
142
68