Skip to content

Commit

Permalink
rebuilt
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Oct 27, 2015
1 parent 5f22a46 commit 2fced78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
if(typeof initOAuth == "function") {
initOAuth({
clientId: "your-client-id",
clientSecret: "your-client-secret",
clientSecret: "your-client-secret-if-required",
realm: "your-realms",
appName: "your-app-name",
scopeSeparator: ","
Expand Down
12 changes: 8 additions & 4 deletions dist/lib/swagger-oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function initOAuth(opts) {
popupMask = (o.popupMask||$('#api-common-mask'));
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
clientId = (o.clientId||errors.push('missing client id'));
clientSecret = (o.clientSecret||errors.push('missing client secret'));
clientSecret = (o.clientSecret||null);
realm = (o.realm||errors.push('missing realm'));
scopeSeparator = (o.scopeSeparator||' ');

Expand All @@ -211,11 +211,15 @@ function initOAuth(opts) {
window.processOAuthCode = function processOAuthCode(data) {
var params = {
'client_id': clientId,
'client_secret': clientSecret,
'code': data.code,
'grant_type': 'authorization_code',
'redirect_uri': redirect_uri
};

if (clientSecret) {
params.client_secret = clientSecret;
}

$.ajax(
{
url : window.swaggerUi.tokenUrl,
Expand All @@ -230,7 +234,7 @@ window.processOAuthCode = function processOAuthCode(data) {
onOAuthComplete("");
}
});
}
};

window.onOAuthComplete = function onOAuthComplete(token) {
if(token) {
Expand Down Expand Up @@ -287,4 +291,4 @@ window.onOAuthComplete = function onOAuthComplete(token) {
}
}
}
}
};

0 comments on commit 2fced78

Please sign in to comment.