blob: 0cde1d3960bac62db76034f9f5c3e6a7fca5816c [file] [log] [blame]
Jian Li1c94b9d2017-02-08 15:47:21 +09001<script>
2var qp = null;
3if(/code|token|error/.test(window.location.hash)) {
4 qp = location.hash.substring(1);
5}
6else {
7 qp = location.search.substring(1);
8}
9qp = qp ? JSON.parse('{"' + qp.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
10 function(key, value) {
11 return key===""?value:decodeURIComponent(value) }
12 ):{}
13
14if (window.opener.swaggerUiAuth.tokenUrl)
15 window.opener.processOAuthCode(qp);
16else
17 window.opener.onOAuthComplete(qp);
18
19window.close();
20</script>