decentralized-identity/did-jwt

JWTPayload "type" property

yhuard opened this issue ยท 3 comments

Hi!

What is the type claim about?

type?: string

AFAIK, it's not a standard claim name (https://datatracker.ietf.org/doc/html/rfc7519#section-4.1), and it's causing issues with the repos I'm working on since 029b429#diff-7cf1756e74ee58d67cca397cf6e4e522b18d04cbcd794affb6429aa912c547f3R235
Thanks!

Edit: by "issues", I mean the TypeScript compiler is now complaining because on our side we also have a type property on the object we want to pass to createJWT, and our type has a different type: type?: string | string[];

Good catch! and thanks for the issues clarification.
You have spotted a bug, so type should indeed be defined as type?: string | string[]

You are welcome to provide a PR to fix JWT.ts#L62 if you are in a hurry.

In my opinion, type should not be defined at all if it's not used by the library. And from what I've seen, it is indeed not used. It was added in b9593dd as part of the "Convert to Typescript" (PR #36), but I couldn't find where it was used, so I guess it was just a mistake.

๐ŸŽ‰ This issue has been resolved in version 5.5.3 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€