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 6.0.0 to 6.0.1

7

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## 6.0.1 - 2016-04-27
This was an immediate change after publishing 6.0.0.
- throw error on invalid options when the payload is not an object ([304f1b33075f79ed66f784e27dc4f5307aa39e27](https://github.com/auth0/node-jsonwebtoken/commit/304f1b33075f79ed66f784e27dc4f5307aa39e27))
## 6.0.0 - 2016-04-27

@@ -12,2 +18,3 @@

- throw error on invalid options like `expiresIn` when the payload is not an object ([304f1b33075f79ed66f784e27dc4f5307aa39e27](https://github.com/auth0/node-jsonwebtoken/commit/304f1b33075f79ed66f784e27dc4f5307aa39e27))
- `expiresInMinutes` and `expiresInSeconds` are deprecated and no longer supported.

@@ -14,0 +21,0 @@ - `notBeforeInMinutes` and `notBeforeInSeconds` are deprecated and no longer supported.

2

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

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

@@ -26,2 +26,12 @@ var Joi = require('joi');

var options_for_objects = [
'expiresIn',
'notBefore',
'noTimestamp',
'audience',
'issuer',
'subject',
'jwtid',
];
module.exports = function(payload, secretOrPrivateKey, options, callback) {

@@ -39,2 +49,10 @@ options = options || {};

payload = xtend(payload);
} else if (typeof payload !== 'object') {
var invalid_options = options_for_objects.filter(function (opt) {
return typeof options[opt] !== 'undefined';
});
if (invalid_options.length > 0) {
throw new Error('invalid ' + invalid_options.join(',') + ' option for ' + (typeof payload ) + ' payload' );
}
}

@@ -41,0 +59,0 @@

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

//v6 version will throw in this case:
it.skip('should throw with expiresIn', function () {
it('should throw with expiresIn', function () {
expect(function () {

@@ -34,2 +34,2 @@ jwt.sign('hello', '123', { expiresIn: '12h' });

});
});
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