Socket
Socket
Sign inDemoInstall

jsonwebtoken

Package Overview
Dependencies
Maintainers
2
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 1.1.1 to 1.1.2

13

index.js

@@ -39,3 +39,3 @@ var jws = require('jws');

if (!jwtString)
return callback(new JsonWebTokenError('jwt must be provided'));
return callback(new JsonWebTokenError('jwt must be provided'));

@@ -60,4 +60,10 @@ var parts = jwtString.split('.');

var payload = this.decode(jwtString);
var payload;
try {
payload = this.decode(jwtString);
} catch(err) {
return callback(err);
}
if (payload.exp) {

@@ -87,3 +93,4 @@ if (Math.floor(Date.now() / 1000) >= payload.exp)

if (error) this.inner = error;
}
};
JsonWebTokenError.prototype = Object.create(Error.prototype);

@@ -90,0 +97,0 @@ JsonWebTokenError.prototype.constructor = JsonWebTokenError;

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

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

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

var token = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' });
it('should be syntactically valid', function() {

@@ -53,3 +53,10 @@ expect(token).to.be.a('string');

it.only('should throw when the payload is not json', function(done) {
var token = jwt.sign('bar', 'secret', { algorithm: 'HS256' });
jwt.verify(token, 'secret', function() {
done();
});
});
});
});
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