jsonwebtoken
Advanced tools
Comparing version 7.1.7 to 7.1.8
{ | ||
"name": "jsonwebtoken", | ||
"version": "7.1.7", | ||
"version": "7.1.8", | ||
"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 = { alg: 'RS256' }; | ||
var header = { typ: 'JWT', alg: 'RS256' }; | ||
var payload = { iat: Math.floor(Date.now() / 1000 ) }; | ||
@@ -25,3 +25,3 @@ | ||
jwt.verify(signed, pub, {typ: 'JWT'}, function(err, p) { | ||
jwt.verify(signed, pub, 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 = { alg: 'none' }; | ||
var header = { typ: 'JWT', alg: 'none' }; | ||
var payload = { iat: Math.floor(Date.now() / 1000 ) }; | ||
@@ -45,3 +45,3 @@ | ||
jwt.verify(signed, null, {typ: 'JWT'}, function(err, p) { | ||
jwt.verify(signed, null, 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,10 +99,4 @@ var JsonWebTokenError = require('./lib/JsonWebTokenError'); | ||
var payload; | ||
var payload=decodedToken.payload; | ||
try { | ||
payload = decode(jwtString); | ||
} catch(err) { | ||
return done(err); | ||
} | ||
if (typeof payload.nbf !== 'undefined' && !options.ignoreNotBefore) { | ||
@@ -109,0 +103,0 @@ if (typeof payload.nbf !== 'number') { |
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
88124
1263