Created
October 25, 2018 08:12
-
-
Save ranwahle/60fa7dd969e8277ee8aeb9d643156e1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.fetch) { | |
const origFetch = fetch; | |
fetch = function(url, options) { | |
if (!options) { | |
options = {}; | |
} | |
// Adding the creadentials option | |
options.credentials = 'include'; | |
// Calling the original fetch method with the credentials option | |
return origFetch(url, options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment