You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says I was wondering if there is a way to add headers after an instance is created? So for example before the user authenticates I don't have an authorization header. But once they login I want to inject the authorization header into the current instance. Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
There are a few ways to do this. By default axios-hooks uses the default axios instance, which you can import anywhere else in code with import axios from 'axios'. In that case you can provide global defaults or even use an interceptor.
Another way would be to use a custom axios instance and configure axios hooks to use it, then use again the axios instance defaults or interceptors to add your header.
As the title says I was wondering if there is a way to add headers after an instance is created? So for example before the user authenticates I don't have an authorization header. But once they login I want to inject the authorization header into the current instance. Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: