mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
use audiences not options.audience pr #22
This commit is contained in:
@@ -62,7 +62,7 @@ module.exports.verify = function(jwtString, secretOrPublicKey, options, callback
|
||||
|
||||
if (options.audience) {
|
||||
var audiences = Array.isArray(options.audience)? options.audience : [options.audience];
|
||||
if (options.audience.indexOf(payload.aud) < 0)
|
||||
if (audiences.indexOf(payload.aud) < 0)
|
||||
return callback(new JsonWebTokenError('jwt audience invalid. expected: ' + payload.aud));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user