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
Fixing ignore set withCredentials false #1852
Conversation
@LcTwisk Can someone please merge this? An invalid cookie got accidentally placed in cookie jar and now all my api requests fail... |
This is looking good! Looks like i need this too... 👍 |
Bump @waeltken @emilyemorehouse This has been sitting here for months, we go live in a month and this is still causing issues if I don't hack this patch in every build... |
until this pull request completed, you can use the workaround below create a file named postinstall.sh and add the codes below #!/usr/bin/env bash
find ./node_modules/axios/lib/adapters/xhr.js -type f -exec sed -i '' -e 's|Add withCredentials to request if needed|Add withCredentials to request if needed. Explicit to set a true or false|g' {} \;
find ./node_modules/axios/lib/adapters/xhr.js -type f -exec sed -i '' -e 's|if (config.withCredentials) {|if (typeof config.withCredentials !== "undefined") {|g' {} \;
find ./node_modules/axios/lib/adapters/xhr.js -type f -exec sed -i '' -e 's|request.withCredentials = true;|request.withCredentials = !!config.withCredentials;|g' {} \; add a postinstall script into package.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! this will fix #1837
if (config.withCredentials) { | ||
request.withCredentials = true; | ||
// Add withCredentials to request if needed. Explicit to set a true or false | ||
if (typeof config.withCredentials !== 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use the isUndefined
function of utils.
Lines 84 to 86 in 8414664
function isUndefined(val) { | |
return typeof val === 'undefined'; | |
} |
Bump on this please! Just hit this issue and am having to use this patch (thanks @gokhandoslu !). @tonwe @Alanscut, happy to redo pull request if it's stuck waiting on that feedback? |
If it helps, I've created a new PR with the feedback #2591. Thanks to everyone on this thread for solutions! |
Closed in favor of #2582. Apologize for the late response. |
Explicit to set a true or false setting.
if (typeof config.withCredentials !== 'undefined') {
request.withCredentials = !!config.withCredentials;
}