jsonwebtoken
Advanced tools
Comparing version 3.1.1 to 3.2.0
@@ -6,4 +6,4 @@ var jws = require('jws'); | ||
module.exports.decode = function (jwt) { | ||
var decoded = jws.decode(jwt); | ||
module.exports.decode = function (jwt, options) { | ||
var decoded = jws.decode(jwt, options); | ||
return decoded && decoded.payload; | ||
@@ -10,0 +10,0 @@ }; |
{ | ||
"name": "jsonwebtoken", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "JSON Web Token implementation (symmetric and asymmetric)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -83,3 +83,3 @@ # jsonwebtoken [![Build Status](https://secure.travis-ci.org/auth0/node-jsonwebtoken.png)](http://travis-ci.org/auth0/node-jsonwebtoken) | ||
} catch(err) { | ||
// err | ||
// err | ||
} | ||
@@ -89,3 +89,3 @@ | ||
jwt.verify(token, 'wrong-secret', function(err, decoded) { | ||
// err | ||
// err | ||
// decoded undefined | ||
@@ -111,6 +111,6 @@ }); | ||
}); | ||
``` | ||
### jwt.decode(token) | ||
### jwt.decode(token [, options]) | ||
@@ -121,2 +121,6 @@ (Synchronous) Returns the decoded payload without verifying if the signature is valid. | ||
`options`: | ||
* `json`: force JSON.parse on the payload even if the header doesn't contain `"typ":"JWT"`. | ||
Example | ||
@@ -146,3 +150,3 @@ | ||
if (err) { | ||
/* | ||
/* | ||
err = { | ||
@@ -172,3 +176,3 @@ name: 'TokenExpiredError', | ||
if (err) { | ||
/* | ||
/* | ||
err = { | ||
@@ -187,7 +191,7 @@ name: 'JsonWebTokenError', | ||
alg Parameter Value | Digital Signature or MAC Algorithm | ||
alg Parameter Value | Digital Signature or MAC Algorithm | ||
----------------|---------------------------- | ||
HS256 | HMAC using SHA-256 hash algorithm | ||
HS384 | HMAC using SHA-384 hash algorithm | ||
HS512 | HMAC using SHA-512 hash algorithm | ||
HS256 | HMAC using SHA-256 hash algorithm | ||
HS384 | HMAC using SHA-384 hash algorithm | ||
HS512 | HMAC using SHA-512 hash algorithm | ||
RS256 | RSASSA using SHA-256 hash algorithm | ||
@@ -194,0 +198,0 @@ RS384 | RSASSA using SHA-384 hash algorithm |
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
29104
210