Checklist
Description
Hello! After looking at old github issues, the docs, and the source code it appears that at some point the ManagementClient was updated to automatically refresh the API token?
My goal/purpose of this ticket is to get a definitive answer to this question. The docs aren't completely clear(in my opinion), and I'm worried I may be misinterpreting the code implementation and existing github issues.
Below is a summary of what I've found:
In the client we see this pre() func as part of a token-middleware, that appears to get called prior to invoking any calls to the ManagementAPI. It seems to call getToken which handles replacing expired tokens.
However, in the node auth0 docs the only relevant mention I can find is here:
As an alternative to making HTTP calls, you can use the node-auth0 library to automatically obtain tokens for the Management API.
While this does imply automatic expiry handling(as it would need to be done with HTTP calls otherwise), but its not 100% clear(to me, apologies if I'm being dense).
In terms of past issues, this one from 2019 says its not implemented but seems outdated. Theres also newer ticket, which I seems to imply(in my opinion) that there is auto token refresh, as it seems the goal it to swap out the interface implementation out for a custom one...
Anyway, it would really help me with developer confidence to have a clear answer to this question, even if I think it does in fact do it.
node-auth0 version
4.37.0
Node.js version
v25.5.0
Checklist
Description
Hello! After looking at old github issues, the docs, and the source code it appears that at some point the ManagementClient was updated to automatically refresh the API token?
My goal/purpose of this ticket is to get a definitive answer to this question. The docs aren't completely clear(in my opinion), and I'm worried I may be misinterpreting the code implementation and existing github issues.
Below is a summary of what I've found:
In the client we see this pre() func as part of a
token-middleware, that appears to get called prior to invoking any calls to the ManagementAPI. It seems to call getToken which handles replacing expired tokens.However, in the
node auth0docs the only relevant mention I can find is here:While this does imply automatic expiry handling(as it would need to be done with HTTP calls otherwise), but its not 100% clear(to me, apologies if I'm being dense).
In terms of past issues, this one from 2019 says its not implemented but seems outdated. Theres also newer ticket, which I seems to imply(in my opinion) that there is auto token refresh, as it seems the goal it to swap out the interface implementation out for a custom one...
Anyway, it would really help me with developer confidence to have a clear answer to this question, even if I think it does in fact do it.
node-auth0 version
4.37.0
Node.js version
v25.5.0