Skip to content

Commit

Permalink
#15 add back oauthOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed May 25, 2017
1 parent e60ef28 commit e1aa0fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ window.onload = function() {
];
// Build a system
const ui = SwaggerUIBundle(options)
{{#if oauthOptions}}
if (ui.hasOwnProperty("initOAuth")) {
ui.initOAuth({{{json oauthOptions}}})
}
{{/if}}
window.ui = ui
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const json = require('../package.json');

const defaultOptions = {
title: 'Swagger UI',
oauthOptions: {},
oauthOptions: false,
swaggerOptions: {
dom_id: '#swagger-ui',
url: 'http://petstore.swagger.io/v2/swagger.json',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koa2-swagger-ui",
"version": "2.4.3",
"version": "2.4.4",
"description": "Swagger UI middleware for koa",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit e1aa0fd

Please sign in to comment.