Skip to content

Commit f5a7b7b

Browse files
committed
jwt header: support custom parameters
1 parent 87a17be commit f5a7b7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ module.exports.sign = function(payload, secretOrPrivateKey, options) {
1010

1111
var header = {typ: 'JWT', alg: options.algorithm || 'HS256'};
1212

13+
if (options.header) {
14+
Object.keys(options.header).forEach(function (k) {
15+
header[k] = options.header[k];
16+
});
17+
}
18+
1319
payload.iat = Math.floor(Date.now() / 1000);
1420

1521
if (options.expiresInMinutes) {

0 commit comments

Comments
 (0)