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

Why do claim need to have binary keys? #362

Open
anthonator opened this issue Jun 7, 2022 · 1 comment
Open

Why do claim need to have binary keys? #362

anthonator opened this issue Jun 7, 2022 · 1 comment

Comments

@anthonator
Copy link

The claims/0 spec is defined as claims() :: %{required(binary()) => term(). I'm curious why the claims you pass into Joken functions need to have binary keys. It also works with atom keys but dialyzer fails.

@victorolinasc
Copy link
Collaborator

This is probably just because claims are JSON data and that is how JSON libraries usually encode to the format. Nothing really "needed" but thought of as a good practice when dealing with JSON in general.

Do you have a particular use case that atom keys would be a nice fit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants