Skip to content

Commit f1cffd0

Browse files
committedApr 22, 2015
Simplified checking for missing key
1 parent ffe68db commit f1cffd0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ module.exports.verify = function(jwtString, secretOrPublicKey, options, callback
107107
return done(new JsonWebTokenError('jwt signature is required'));
108108
}
109109

110-
if (typeof secretOrPublicKey === "undefined" || secretOrPublicKey === null) // secretOrPublicKey can be empty string
110+
if (!secretOrPublicKey) {
111111
return done(new JsonWebTokenError('secret or public key must be provided'));
112+
}
112113

113114
if (!options.algorithms) {
114115
options.algorithms = ~secretOrPublicKey.toString().indexOf('BEGIN CERTIFICATE') ||

0 commit comments

Comments
 (0)
Please sign in to comment.