Skip to content

Commit 55d5834

Browse files
author
Mircea Danila Dumitrescu
committed
Removing unnecessary extra decoding. jwtString is already verified as valid and signature checked
1 parent 5117aac commit 55d5834

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

verify.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,7 @@ module.exports = function (jwtString, secretOrPublicKey, options, callback) {
9696
if (!valid)
9797
return done(new JsonWebTokenError('invalid signature'));
9898

99-
var payload;
100-
101-
try {
102-
payload = decode(jwtString);
103-
} catch(err) {
104-
return done(err);
105-
}
99+
var payload=decodedToken.payload;
106100

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

0 commit comments

Comments
 (0)