Browse Source

added sanitization of scopes per #2483

bubble
Tony Tam 7 years ago
parent
commit
47ab2a32c0
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      src/main/javascript/view/Oauth2Model.js

+ 13
- 0
src/main/javascript/view/Oauth2Model.js View File

@@ -6,6 +6,19 @@ SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
},

initialize: function () {
if(this.attributes && this.attributes.scopes) {
var attributes = _.cloneDeep(this.attributes);
var i, scopes = [];
for(i in attributes.scopes) {
var scope = attributes.scopes[i];
if(typeof scope.description === 'string') {
scopes[scope] = attributes.scopes[i];
scopes.push(attributes.scopes[i]);
}
}
attributes.scopes = scopes;
this.attributes = attributes;
}
this.on('change', this.validate);
},



Loading…
Cancel
Save