First time social login no permissions in JWT


The problem we are trying to solve is that we want users to have a default role after account creation or first social login.

With the “Post User Registration” action we can solve this if the user uses self registration and no social provider.

With the " Login flow" we can update the roles for every provider (non social and social). However the JWT does NOT include the newly added roles/ permissions on the first login.

What would be the best way to attach a role with permissions to a new user for both self registered users and social, and include these permissions on the first login to the JWT?

Side note, the diagram seems to display that our action is executed BEFORE issueing a JWT but the permissions are not included on first login.

I get that the pre/post login are not meant for social providers, but a universal fire always on first login/registration would be helpfull. Or the ability to set default roles without actions by just using the dashboard.

Thanks for reading this long post and your time.


Hi @meesvanstraten

The easiest workaround is to do silentAuth and get a new token if the JWT doesn’t have the role/permission. This is a “caching” issue, the action updates the role, but it is not finalized until the actions are complete, so other actions do not have this updated info available.