Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
5 replies
arete

is there a way to change/refresh token when data in db changes such as role?

Hi, I had a project using NextAuth as my provider and the JWT strategy. When I use the database strategy, whenever I change the user’s role, they are automatically redirected to their own page. However, when I use the JWT strategy, I have to log out and log in again to get the newest token. Is there any way I can change the behavior so the token automatically refreshes when I change the role?
Was this page helpful?