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

Include users role in JSON web tokens #128

Open
harryrigg opened this issue Nov 5, 2024 · 1 comment
Open

Include users role in JSON web tokens #128

harryrigg opened this issue Nov 5, 2024 · 1 comment
Labels
backend Task must have a back end issue difficulty:easy enhancement New feature or request frontend Task must have a front end issue

Comments

@harryrigg
Copy link
Collaborator

harryrigg commented Nov 5, 2024

The users role (e.g. attendee or poster) should be included in the JSON web tokens sent from the back end.

This will simplify things on the front end, and allow easily sending the role to the NextJS middleware so that it can be used to determine route access permissions.

Once completed, the global JwtPayload type (found in globals.d.ts) should be updated to include the field, and the value should be exposed from the access token in the AuthProvider.

Should be very simple: https://django-rest-framework-simplejwt.readthedocs.io/en/latest/customizing_token_claims.html

@harryrigg harryrigg added backend Task must have a back end issue enhancement New feature or request difficulty:easy labels Nov 5, 2024
@harryrigg harryrigg added the frontend Task must have a front end issue label Nov 5, 2024
@ZenFlamex ZenFlamex self-assigned this Nov 23, 2024
Copy link

Branch issue-128-Include_users_role_in_JSON_web_tokens created!

@ZenFlamex ZenFlamex removed their assignment Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Task must have a back end issue difficulty:easy enhancement New feature or request frontend Task must have a front end issue
Projects
None yet
Development

No branches or pull requests

2 participants