Q: In my app, when a user creates a new Org, they are set as the owner
of that Org. I then need the user’s client to refresh its JWT token to show the changes.
How do I do this without forcing the user to manually re-login?
A: There’s an optional parameter to Get a Session that will do what you need. When validating a session, it will return the JWT with updated user/org/membership data:
GET /v1/sessions/:id?expand=token
This assumes that you already have Extended JWT token data enabled under: Settings -> Sessions & JWT.
Tagged with: sessions
updated user data
Questions? Find a Typo? Get in touch.
Related articles:
Connecting Existing User Data
Limits on Simultaneous User Sessions
User Impersonation
Returning a JWT with Updated User and Org Data
Using AuthRocket with a Static Website
Getting Memberships when Authenticating a User
Making User Login Easier and Faster
Super Users and Support Agents
Create a Session without User Intervention
What is Inside a Login Token?
User Management Permissions
Testing API Calls
Retrieving Permissions
Encoding Extended Information into a JWT
Nesting Permissions