Additional User Data in Auth

default discord avatar
Sandro Wegmannlast year
3

I need to add an attribute to the user called activeSite which should be used in access control. However, it seems like by default, only user email and collection are stored in the auth object of the user.



How can I add an additional field to the auth user object?

  • default discord avatar
    thisisnotchrislast year

    @Sandro Wegmann I think you need to add the saveToJWT property for the field



    To add fields to the auth token

  • default discord avatar
    Sandro Wegmannlast year

    Ah thanks a ton! I had such a property in mind but couldn’t find it anywhere 😄

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.