Is your feature request related to a problem? Please describe.
When having to perform tasks such as check and renew a token client side to use in the headers, it is not possible to await async methods as the setAdditionalHeadersProvider is itself not async.
At the moment we have issues where if a use leaves a visualisation open and half built, and then returns after their auth token has expired, an error is thrown as we cannot capture the event and refresh the token.
Describe the solution you'd like
Ability to await while a task is completed (e.g. check and renew if needed a JWT) on further calls to the datasource not just load.
Describe alternatives you've considered
A timer that triggers in the background to refresh the token and reading the token from local storage on every header sent.
Additional context
Please see the Discord thread. Also, to be clear, I'm requesting this for React.
Is your feature request related to a problem? Please describe. When having to perform tasks such as check and renew a token client side to use in the headers, it is not possible to await async methods as the setAdditionalHeadersProvider is itself not async.
At the moment we have issues where if a use leaves a visualisation open and half built, and then returns after their auth token has expired, an error is thrown as we cannot capture the event and refresh the token.
Describe the solution you'd like Ability to await while a task is completed (e.g. check and renew if needed a JWT) on further calls to the datasource not just load.
Describe alternatives you've considered A timer that triggers in the background to refresh the token and reading the token from local storage on every header sent.
Additional context Please see the Discord thread. Also, to be clear, I'm requesting this for React.