passing token in missing headers
This commit is contained in:
@@ -5,6 +5,9 @@ export function attachAuthInterceptors(client: AxiosInstance) {
|
||||
client.interceptors.request.use((config) => {
|
||||
const token = tokenStore.get();
|
||||
if (token) {
|
||||
if (!config.headers) {
|
||||
(config as any).headers = {};
|
||||
}
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user