Socket
Socket
Sign inDemoInstall

jsonwebtoken

Package Overview
Dependencies
Maintainers
6
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 5.0.2 to 5.0.3

17

index.js
var jws = require('jws');
var JsonWebTokenError = module.exports.JsonWebTokenError = require('./lib/JsonWebTokenError');
var TokenExpiredError = module.exports.TokenExpiredError = require('./lib/TokenExpiredError');
var JWT = module.exports;
module.exports.decode = function (jwt, options) {
var JsonWebTokenError = JWT.JsonWebTokenError = require('./lib/JsonWebTokenError');
var TokenExpiredError = JWT.TokenExpiredError = require('./lib/TokenExpiredError');
JWT.decode = function (jwt, options) {
options = options || {};

@@ -21,3 +24,3 @@ var decoded = jws.decode(jwt, options);

}
//return header if `complete` option is enabled. header includes claims

@@ -36,3 +39,3 @@ //such as `kid` and `alg` used to select the key within a JWKS needed to

module.exports.sign = function(payload, secretOrPrivateKey, options) {
JWT.sign = function(payload, secretOrPrivateKey, options) {
options = options || {};

@@ -86,3 +89,3 @@

module.exports.verify = function(jwtString, secretOrPublicKey, options, callback) {
JWT.verify = function(jwtString, secretOrPublicKey, options, callback) {
if ((typeof options === 'function') && !callback) {

@@ -166,3 +169,3 @@ callback = options;

try {
payload = this.decode(jwtString);
payload = JWT.decode(jwtString);
} catch(err) {

@@ -169,0 +172,0 @@ return done(err);

{
"name": "jsonwebtoken",
"version": "5.0.2",
"version": "5.0.3",
"description": "JSON Web Token implementation (symmetric and asymmetric)",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -139,3 +139,3 @@ # jsonwebtoken [![Build Status](https://secure.travis-ci.org/auth0/node-jsonwebtoken.png)](http://travis-ci.org/auth0/node-jsonwebtoken)

* `json`: force JSON.parse on the payload even if the header doesn't contain `"typ":"JWT"`.
* `complete`: return an object with the decode payload and header.
* `complete`: return an object with the decoded payload and header.

@@ -142,0 +142,0 @@ Example

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc