Add ability to override redirectUrl in swagger-oauth

Fixes #457
This commit is contained in:
Mohsen Azimi
2015-03-24 10:40:36 -07:00
parent b78a8e5fdc
commit ede1faa0c8
6 changed files with 15 additions and 4 deletions

View File

@@ -97,7 +97,8 @@ function handleLogin() {
var authSchemes = window.swaggerUi.api.authSchemes;
var host = window.location;
var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
var redirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
var defaultRedirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
var redirectUrl = window.oAuthRedirectUrl || defaultRedirectUrl;
var url = null;
for (var key in authSchemes) {