authProvider onError Only Called on Final Error
Hi!
I have an authentication token for my API that expires after a certain amount of time.
Once it does, the application receives an error when it tries to fetch data (as expected).
I have authProvider's onError set up so that when it receives a 401, it logs the user out and redirects them to the login page.
However, onError is only called after multiple failures.
I'm wondering if I can log the user out via an Axios interceptor rather than authProvider's onError?
I have an authentication token for my API that expires after a certain amount of time.
Once it does, the application receives an error when it tries to fetch data (as expected).
I have authProvider's onError set up so that when it receives a 401, it logs the user out and redirects them to the login page.
However, onError is only called after multiple failures.
I'm wondering if I can log the user out via an Axios interceptor rather than authProvider's onError?

