We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0a9888f + b82831b commit 38d168eCopy full SHA for 38d168e
index.js
@@ -8,7 +8,9 @@ module.exports.decode = function (jwt) {
8
module.exports.sign = function(payload, secretOrPrivateKey, options) {
9
options = options || {};
10
11
- var header = {typ: 'JWT', alg: options.algorithm || 'HS256'};
+ var header = ((typeof options.headers === 'object') && options.headers) || {};
12
+ header.typ = 'JWT';
13
+ header.alg = options.algorithm || 'HS256';
14
15
if (options.header) {
16
Object.keys(options.header).forEach(function (k) {
0 commit comments