oauth2: don't mutate global scopes object

This commit is contained in:
Christian Tellnes
2016-04-26 15:28:52 +02:00
parent ba0a396d14
commit b1358ba881

View File

@@ -20,6 +20,7 @@ window.SwaggerUi.utils = {
auths[key] = auths[key] || {};
if (auths[key].type === 'oauth2') {
singleOauth2Security[key] = Object.assign({}, auths[key]);
singleOauth2Security[key].scopes = Object.assign({}, auths[key].scopes);
for (var i in singleOauth2Security[key].scopes) {
if (item[key].indexOf(i) < 0) {
delete singleOauth2Security[key].scopes[i];