Socket
Socket
Sign inDemoInstall

jsonwebtoken

Package Overview
Dependencies
Maintainers
7
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 7.1.8 to 7.1.9

2

package.json
{
"name": "jsonwebtoken",
"version": "7.1.8",
"version": "7.1.9",
"description": "JSON Web Token implementation (symmetric and asymmetric)",

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

@@ -14,3 +14,3 @@ var jwt = require('../index');

it('should first assume JSON claim set', function (done) {
var header = { typ: 'JWT', alg: 'RS256' };
var header = { alg: 'RS256' };
var payload = { iat: Math.floor(Date.now() / 1000 ) };

@@ -25,3 +25,3 @@

jwt.verify(signed, pub, function(err, p) {
jwt.verify(signed, pub, {typ: 'JWT'}, function(err, p) {
assert.isNull(err);

@@ -34,3 +34,3 @@ assert.deepEqual(p, payload);

it('should be able to validate unsigned token', function (done) {
var header = { typ: 'JWT', alg: 'none' };
var header = { alg: 'none' };
var payload = { iat: Math.floor(Date.now() / 1000 ) };

@@ -45,3 +45,3 @@

jwt.verify(signed, null, function(err, p) {
jwt.verify(signed, null, {typ: 'JWT'}, function(err, p) {
assert.isNull(err);

@@ -100,3 +100,3 @@ assert.deepEqual(p, payload);

clock = sinon.useFakeTimers(1437018584000);
var options = {algorithms: ['HS256'], clockTolerance: 100};
var options = {algorithms: ['HS256'], clockTolerance: 100}

@@ -103,0 +103,0 @@ jwt.verify(token, key, options, function (err, p) {

@@ -99,4 +99,10 @@ var JsonWebTokenError = require('./lib/JsonWebTokenError');

var payload=decodedToken.payload;
var payload;
try {
payload = decode(jwtString);
} catch(err) {
return done(err);
}
if (typeof payload.nbf !== 'undefined' && !options.ignoreNotBefore) {

@@ -103,0 +109,0 @@ if (typeof payload.nbf !== 'number') {

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