Closed pharmarin closed 4 years ago
Header will not update when I try to add JWT in Authorization header. interceptors: {
interceptors: {
request: [ ({ getState, dispatch, getSourceAction }, req) => { const needAuth = get( getSourceAction(req), 'payload.request.auth', ); if (needAuth) { const token = get(getState(), 'auth.tokens.access_token'); req.headers.Authorization = `Bearer ${token}`; } return req; }, ],
},
I tried to add other type of header and it works if I try to add random header. But when I want to change Authorization it fails.
I changed the auth value from action.payload.request.auth to action.auth and it solved the problem. Sorry for the inconvenience.
Header will not update when I try to add JWT in Authorization header.
interceptors: {
},
I tried to add other type of header and it works if I try to add random header. But when I want to change Authorization it fails.