codersforcauses / codersforcauses/coexist

Include users role in JSON web tokens

Open
#128 1 comment 0 reactions 0 assignees View on GitHub
backend difficulty:easy enhancement frontend
Dominant language
TypeScript
Stars
7
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.