Socket
Socket
Sign inDemoInstall

jsonwebtoken

Package Overview
Dependencies
3
Maintainers
7
Versions
81
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.6.2 to 5.7.0

7

index.js

@@ -257,4 +257,9 @@ var jws = require('jws');

if (options.issuer) {
if (payload.iss !== options.issuer)
var invalid_issuer =
(typeof options.issuer === 'string' && payload.iss !== options.issuer) ||
(Array.isArray(options.issuer) && options.issuer.indexOf(payload.iss) === -1);
if (invalid_issuer) {
return done(new JsonWebTokenError('jwt issuer invalid. expected: ' + options.issuer));
}
}

@@ -261,0 +266,0 @@

2

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

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

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

* `audience`: if you want to check audience (`aud`), provide a value here
* `issuer`: if you want to check issuer (`iss`), provide a value here
* `issuer` (optional): string or array of strings of valid values for the `iss` field.
* `ignoreExpiration`: if `true` do not validate the expiration of the token.

@@ -84,0 +84,0 @@ * `ignoreNotBefore`...

@@ -270,2 +270,10 @@ var jwt = require('../index');

it('should check the issuer when providing a list of valid issuers', function(done) {
jwt.verify(token, pub, { issuer: [ 'urn:foo', 'urn:bar' ] }, function(err, decoded) {
assert.isNotNull(decoded);
assert.isNull(err);
done();
});
});
it('should throw when invalid issuer', function(done) {

@@ -272,0 +280,0 @@ jwt.verify(token, pub, { issuer: 'urn:wrong' }, function(err, decoded) {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc