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

Allow adding more field to payload of encoded token #808

Closed
hoaibao44 opened this issue May 14, 2024 · 2 comments
Closed

Allow adding more field to payload of encoded token #808

hoaibao44 opened this issue May 14, 2024 · 2 comments

Comments

@hoaibao44
Copy link

Situation:

  • when using Nextjs as frontend, I need ability to add user_role to payload of the encoded token
  • so that, Nextjs can know which role of current user, then dynamically render the content, with out any additional API call

What do I know:

  • I read the source, in this file, currently, the only claim we can set is via USER_ID_CLAIM

Expected:
image

So the question is:

  • Is there any way to achieve this?
@hoaibao44 hoaibao44 changed the title Allow adding more field to encoded token Allow adding more field to payload of encoded token May 14, 2024
@confuzeus
Copy link

You can do it by customizing the claims

@hoaibao44
Copy link
Author

Thank you @confuzeus
I missed that on the document.

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