I’m running into an issue with my Next.js backend where when I callnew managementClient()
inside a route & then execute an action with it, it returns a message “Expired token received for JSON Web Token validation”. I’m getting the client with domain, clientid, & clientsecret as args & it did work up until today when I started getting this error and can’t get it to disappear.
My first thought was that the small function I created to basically reuse the management client if it already existed to reduce the number of api calls was causing it not be refreshed. However, even after removing that & creating a new management client for each request, that still didn’t fix the issue and I received the same error.
I’m not exactly sure how to fix this since I’ve followed all the docs provided by auth0 so besides going and creating a manual process to refresh the management api token via http request calls, I don’t know what the next step would be. It was my understanding that using nodejs library, clientid-clientsecret, & managementClient utility it would handle refreshes on its own.