Skip to content

Include users role in JSON web tokens #128

Description

@harryrigg

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendTask must have a back end issuedifficulty:easyenhancementNew feature or requestfrontendTask must have a front end issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions