Is there a way to block all api calls while I wait for the refresh endpoint to return? I know axios has interceptors, but how would I delay all subsequent calls after the access token has expired? Otherwise the user would just get some error messages if it clicks something while the access token is still being refreshed. Seems more complicated than I first thought, am I missing something, is there some library that can already manage this?
I guess I could create a queue and cancel all calls while refresh is still ongoing, and then re-run those requests from the queue, but is there a more elegant/already implemented way?
Not to mention, I should also consider more than one tab could be open with the same session, so probably a BroadcastChannel is needed too. It gets pretty complex...