I’m using ReactJS with NextJS and the Auth0 SDK for my application. I’ve integrated <UseProvider> in my layout.tsx file, and the login, signup, and logout functionalities work perfectly.
I’ve also integrated the Stripe payment API to allow users to subscribe to the premium mode. After a successful payment, I call my own API using Auth0’s API Management to update the user’s role to “premium.”
However, I can’t figure out how to update the user’s session on the client side (ReactJS/NextJS) without logging them out, in order to give them access to certain premium resources in my app, etc, so i need to access rôle, i have already create a actions but its for post login…
Do you have any ideas or solutions to solve this issue?
To fix this, you must obtain a refresh token. One way to do so is to set the refresh value equal to true. Take a look at the sample code below, along with the relevant documentation for more details.