brunoams opened a new issue, #24666:
URL: https://github.com/apache/superset/issues/24666

   ### Summary:
   Hello everyone. I encountered this problem of not being able to refresh the 
token after 5 minutes on the dashboard screen and noticed that there isn't a 
very clear solution to this issue, at least I didn't find one.
   
   Including this Issue that attempts to address the same topic: #20817
   
   ### Problem:
   The error occurs as follows:
   1. We enter the dashboard screen;
   2. The dashboards load normally;
   3. After 5 minutes, if you try to do anything, apply filters, etc., it 
returns this error:
   ```
   This endpoint requires the datasource app1_demo.tbl_1_locationwise, database 
or `all_datasource_access` permission
   ```
   ### Solution:
   After doing some debugging, I noticed that the component uses `Buffer` to 
handle the first `token`, and then creates a `setTimeout` to refresh it every 5 
minutes.
   
![image](https://github.com/apache/superset/assets/42622347/92334aa2-6165-4983-bb2b-0b69979d82d5)
   
![image](https://github.com/apache/superset/assets/42622347/96ccfd4d-18d8-4cf8-ac31-64ba5949fa35)
   
   In my case, I saw that `Buffer` was `null`.
   So, basically I solved it in the way I'll describe below.
   
   - I installed the `Buffer` package `npm install Buffer`
   - In the `index.html` file I added:
   ```
   <script>
       var global = global || window;
   </script>
   ```
   - In the `polyfills.ts` file, add this line of code:
   `global.Buffer = global.Buffer || require('buffer').Buffer;`
   
   The resolution was based on this stackoverflow question: 
https://stackoverflow.com/a/50377270/10580566
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to