Skip to content

Instantly share code, notes, and snippets.

@K0NRAD
Last active April 25, 2017 16:42
Show Gist options
  • Save K0NRAD/50d488b75fb7ce70f4cbe40861314b70 to your computer and use it in GitHub Desktop.
Save K0NRAD/50d488b75fb7ce70f4cbe40861314b70 to your computer and use it in GitHub Desktop.
Swagger-UI with CORS and Cookies
// 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