Last active
April 25, 2017 16:42
-
-
Save K0NRAD/50d488b75fb7ce70f4cbe40861314b70 to your computer and use it in GitHub Desktop.
Swagger-UI with CORS and Cookies
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
// Add the follow Code Snippet to index.html from swagger-ui v2.x.x | |
// ... | |
window.swaggerUi = new SwaggerUi({ | |
url: url, | |
// --- --- --- ---- | |
useJQuery: true, | |
authorizations: { | |
makeCredentialed: function() { | |
this.xhrFields = {withCredentials: true}; // The important bit, along with useJQuery | |
return true; | |
} | |
}, | |
// --- --- --- ---- | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment