Closed step135 closed 9 months ago
It is sometimes needed to add some parameters to the header, e.g. kid. I had to modify sign method to enable it. You should find some consistent solution as it is ugly to put another sometimes compulsory (fourth) parameter after options.
sign
The options argument accepts a header field.
header
So await sign({hello: "world"}, "KEY", { header: { typ: "JWT", kid: "..." } }) should work
await sign({hello: "world"}, "KEY", { header: { typ: "JWT", kid: "..." } })
It is sometimes needed to add some parameters to the header, e.g. kid. I had to modify
sign
method to enable it. You should find some consistent solution as it is ugly to put another sometimes compulsory (fourth) parameter after options.