Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWTPayload "type" property #184

Closed
yhuard opened this issue Jun 4, 2021 · 3 comments · Fixed by #185
Closed

JWTPayload "type" property #184

yhuard opened this issue Jun 4, 2021 · 3 comments · Fixed by #185
Labels
bug Something isn't working good first issue Good for newcomers released

Comments

@yhuard
Copy link
Contributor

yhuard commented Jun 4, 2021

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[];

@mirceanis mirceanis added bug Something isn't working good first issue Good for newcomers labels Jun 4, 2021
@mirceanis
Copy link
Member

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.

@yhuard
Copy link
Contributor Author

yhuard commented Jun 5, 2021

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.

@uport-automation-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 5.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants