Skip to content

Commit

Permalink
Removing unnecessary extra decoding. jwtString is already verified as…
Browse files Browse the repository at this point in the history
… valid and signature checked
  • Loading branch information
Mircea Danila Dumitrescu committed Aug 10, 2016
1 parent 5117aac commit 55d5834
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,7 @@ module.exports = function (jwtString, secretOrPublicKey, options, callback) {
if (!valid)
return done(new JsonWebTokenError('invalid signature'));

var payload;

try {
payload = decode(jwtString);
} catch(err) {
return done(err);
}
var payload=decodedToken.payload;

if (typeof payload.nbf !== 'undefined' && !options.ignoreNotBefore) {
if (typeof payload.nbf !== 'number') {
Expand Down

0 comments on commit 55d5834

Please sign in to comment.