Socket
Socket
Sign inDemoInstall

jsonwebtoken

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonwebtoken - npm Package Compare versions

Comparing version 3.1.1 to 3.2.0

4

index.js

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

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