Skip to content

Commit d380a17

Browse files
committed
Merge branch 'master' of https://github.com/mprinc/node-jsonwebtoken into mprinc-master
2 parents eea7208 + f41559a commit d380a17

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports.sign = function(payload, secretOrPrivateKey, options) {
3838
};
3939

4040
module.exports.verify = function(jwtString, secretOrPublicKey, options, callback) {
41-
if ((typeof options === 'function') && !callback) callback = options;
41+
if ((typeof options === 'function') && !callback) callback = options, options = null;
4242
if (!options) options = {};
4343

4444
if (!jwtString)

test/jwt.hs.tests.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ describe('HS256', function() {
1515
expect(token.split('.')).to.have.length(3);
1616
});
1717

18+
it('should without options', function(done) {
19+
var callback = function(err, decoded) {
20+
assert.ok(decoded.foo);
21+
assert.equal('bar', decoded.foo);
22+
done();
23+
};
24+
callback.issuer = "shouldn't affect";
25+
jwt.verify(token, secret, callback );
26+
});
27+
1828
it('should validate with secret', function(done) {
1929
jwt.verify(token, secret, function(err, decoded) {
2030
assert.ok(decoded.foo);

0 commit comments

Comments
 (0)