diff --git a/src/main/javascript/view/OperationView.js b/src/main/javascript/view/OperationView.js index befbb260..6891f5a1 100644 --- a/src/main/javascript/view/OperationView.js +++ b/src/main/javascript/view/OperationView.js @@ -89,22 +89,23 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({ for (l = 0, len = modelAuths.length; l < len; l++) { auths = modelAuths[l]; for (key in auths) { - auth = auths[key]; for (a in this.auths) { auth = this.auths[a]; - if (auth.type === 'oauth2') { - this.model.oauth = {}; - this.model.oauth.scopes = []; - ref1 = auth.value.scopes; - for (k in ref1) { - v = ref1[k]; - scopeIndex = auths[key].indexOf(k); - if (scopeIndex >= 0) { - o = { - scope: k, - description: v - }; - this.model.oauth.scopes.push(o); + if (key === auth.name) { + if (auth.type === 'oauth2') { + this.model.oauth = {}; + this.model.oauth.scopes = []; + ref1 = auth.value.scopes; + for (k in ref1) { + v = ref1[k]; + scopeIndex = auths[key].indexOf(k); + if (scopeIndex >= 0) { + o = { + scope: k, + description: v + }; + this.model.oauth.scopes.push(o); + } } } }