In tchap web it is done in the service worker to intercept the request in order to add an auth header if necessary