You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented a role system (it's just extending the user with an array of roles):
My callbacks:
jwt: async({ token, user })=>{if(user?.roles){token.roles=user.roles;}returntoken;},session: async({ session, token, user })=>{if(token?.roles){session.user.roles=token.rolesasstring[];}returnsession;},
Does anyone know how to refresh the token in case the roles change without having the user authenticate again?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I have implemented a role system (it's just extending the user with an array of roles):
My callbacks:
Does anyone know how to refresh the token in case the roles change without having the user authenticate again?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions