Is changing fields on Session regularly good or bad practice?
In this example, I've got a new field on the session.user object called activeTeamId. This is then used to decide which team data to display for a user on a homepage. It also is used to create some trpc middleware that checks info about the user and their permissions on that team (whether they have admin privileges, etc).
When a user switches teams in the app, I was planning to just update this session.user.activeTeamId field. Noticed that updates the session don't seem to propagate throughout the app super reliably (have not done a deep dive to examine why), so I was just wondering if there is some reason this is generally a bad pattern to use. Thanks!
1 Reply
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View