New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axios Interceptor (Response) doesn't update the header [resubmit] #4039
Comments
@farrokh In my case, I did the following to update. I manually changed the version of axiox in package.json - "axios": "^0.21.2",
+ "axios": "^0.21.4", |
@digitter {
"dependencies": {
"@artsy/fresnel": "^1.7.0",
"@babel/core": "^7.0.0-0",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"@prisma/client": "^2.25.0",
"axios": "^0.21.4",
"csstype": "^2.6.2",
"dotenv": "^10.0.0",
"ics": "^2.31.0",
"lodash": "^4.17.21",
"mongodb": "^4.1.0",
"next": "^11.1.0",
"next-auth": "^3.23.1",
"nodemailer": "^6.6.3",
"react": "^17.0.2",
"react-currency-input-field": "^3.4.1",
"react-dom": "^17.0.2",
"react-easy-crop": "^3.5.1",
"react-hot-toast": "^2.1.1",
"react-map-gl": "^6.1.16",
"react-phone-input-2": "^2.14.0",
"react-query": "^3.16.0",
"react-select": "^4.3.1",
"react-simple-star-rating": "^1.0.6",
"safe-json-stringify": "^1.2.0",
"sass": "^1.35.0",
"supercluster": "^7.1.3",
"thumbor": "^0.1.5",
"twilio-video": "^2.15.1",
"typescript": "^4.3.2",
"use-debounce": "^6.0.1",
"use-supercluster": "^0.2.9"
},
"devDependencies": {
"eslint": "^7.28.0",
"eslint-config-next": "^11.0.0"
}
} and in my yarn.lock I have this line:
|
@farrokh Another problem or may be referring to node_modules in another directory. These are my guesses. |
Hi 👋 Please could you retry with the latest version and open a new issue should this error still be relevant? Thanks |
Describe the bug
I'm using axios in my nextJS prject. We have a JWT authentication system where I'm trying to use an axios interceptor to update the expired tokens on 401 error.
Some how I cant manage to update the new requests with the updated headers!
To Reproduce
Here is my code:
since I want to receive an error I put
token
string in the request interceptor. When I console log the process I don't see the updated token in the requests:Expected behavior
I'm expecting to get an updated request.
Environment
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: