Implement Silent Refresh for Auth Tokens with CubeProvider
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
**Is your feature request related to a problem? Please describe.**
Hello, our application has security restrictions where we must refresh our access tokens regularly. We noticed that when you refresh the access token, that all API calls utilizing the `useCubeQuery` hook reload, which causes random UI/UX updates that the user would not be expecting. There is currently no method to bypass this behavior
**Describe the solution you'd like**
We would like the ability to silently update the access token used in CubeJS API requests without having to affect options on a query level. Ideally, a flag can be passed on the CubeProvider to dictate this behavior for all API requests, and an additional flag can be passed on the useCubeQuery level to override this behavior for any query-specific needs.
**Describe alternatives you've considered**
N/A
**Additional context**
Here is where the error originates: https://github.com/cube-js/cube/blob/master/packages/cubejs-client-react/src/hooks/cube-query.js#L131
Contributor guide
Assessment
This issue has not been assessed yet.