diff --git a/verify.js b/verify.js index d10bfab..4b0c6fd 100644 --- a/verify.js +++ b/verify.js @@ -164,6 +164,12 @@ module.exports = function (jwtString, secretOrPublicKey, options, callback) { } } + if (options.nonce) { + if (payload.nonce !== options.nonce) { + return done(new JsonWebTokenError('jwt nonce invalid. expected: ' + options.nonce)); + } + } + if (options.maxAge) { var maxAge = ms(options.maxAge); if (typeof payload.iat !== 'number') {