Remove global auth object references and fix header api key adding mechanism

Fixes #1033
This commit is contained in:
Mohsen Azimi
2015-03-16 12:47:50 -07:00
parent 9ed1ad88ec
commit 66adb0d508
8 changed files with 33 additions and 16 deletions

9
dist/index.html vendored
View File

@@ -61,8 +61,9 @@
var key = encodeURIComponent($('#input_apiKey')[0].value);
log("key: " + key);
if(key && key.trim() != "") {
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
log("added key " + key);
window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query"));
}
}
@@ -78,6 +79,12 @@
*/
window.swaggerUi.load();
function log() {
if ('console' in window) {
console.log.apply(console, arguments);
}
}
});
</script>
</head>