Closed NarenderSiri closed 1 year ago
Store value I want to use here .. This is too important to me . Please give answer
export default function setupAxios(axios, store) { axios.interceptors.request.use( (config) => { const { auth: { tokens: { authorization_token } }, } = store.getState();
if (authorization_token) { config.headers.Authorization = `Bearer ${authorization_token}`; } return config; },
(err) => Promise.reject(err) ); }
if you are using session storage, you can just query the session storage data.
Store value I want to use here .. This is too important to me . Please give answer
export default function setupAxios(axios, store) { axios.interceptors.request.use( (config) => { const { auth: { tokens: { authorization_token } }, } = store.getState();
(err) => Promise.reject(err) ); }