Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Commit 9a3dd6c

Browse files
committed
release 0.5.4
1 parent b678f97 commit 9a3dd6c

16 files changed

+130
-45
lines changed

dist/css/swagger-ui.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Orange angular-swagger-ui - v0.5.3
2+
* Orange angular-swagger-ui - v0.5.4
33
*
44
* (C) 2015 Orange, all right reserved
55
* MIT Licensed
@@ -329,6 +329,9 @@
329329
border: 0;
330330
box-shadow: none;
331331
}
332+
.swagger-auth-modal span.form-control.text {
333+
height: auto;
334+
}
332335
.swagger-auth-modal .buttons {
333336
text-align: center;
334337
}

dist/css/swagger-ui.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/less/swagger-ui.less

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Orange angular-swagger-ui - v0.5.3
2+
* Orange angular-swagger-ui - v0.5.4
33
*
44
* (C) 2015 Orange, all right reserved
55
* MIT Licensed
@@ -349,6 +349,9 @@
349349
span.form-control{
350350
border: 0;
351351
box-shadow: none;
352+
&.text {
353+
height: auto;
354+
}
352355
}
353356

354357
.buttons{
@@ -377,4 +380,5 @@
377380
padding-left: 20px;
378381
color: #999;
379382
}
383+
380384
}

dist/oauth2-redirect.html

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<body onload="run()">
4+
</body>
5+
</html>
6+
<script>
7+
'use strict';
8+
function run () {
9+
var oauth2 = window.opener.redirectOauth2,
10+
sentState = oauth2.state,
11+
redirectUrl = oauth2.redirectUrl,
12+
isValid, queryParams, array;
13+
14+
if (/code|token|error/.test(window.location.hash)) {
15+
queryParams = window.location.hash.substring(1);
16+
} else {
17+
queryParams = location.search.substring(1);
18+
}
19+
20+
array = queryParams.split('&');
21+
array.forEach(function (v,i,_array) { _array[i] = '"' + v.replace('=', '":"') + '"';});
22+
queryParams = queryParams ? JSON.parse('{' + array.join() + '}',
23+
function (key, value) {
24+
return key === '' ? value : decodeURIComponent(value)
25+
}
26+
) : {};
27+
28+
isValid = queryParams.state === sentState;
29+
30+
if (oauth2.flow === 'accessCode' || oauth2.flow === 'authorizationCode') {
31+
if (!isValid) {
32+
oauth2.error({
33+
level: 'warning',
34+
message: 'Authorization may be unsafe, passed state was changed in server passed state wasn\'t returned from auth server'
35+
});
36+
}
37+
if (queryParams.code) {
38+
oauth2.callback({code: queryParams.code, redirectUrl: redirectUrl});
39+
} else {
40+
oauth2.error({
41+
level: 'error',
42+
message: 'Authorization failed: no accessCode received from the server'
43+
});
44+
}
45+
} else if (oauth2.flow === 'implicit') {
46+
if (!isValid) {
47+
oauth2.error({
48+
level: 'warning',
49+
message: 'Authorization may be unsafe, passed state was changed in server passed state wasn\'t returned from auth server'
50+
});
51+
}
52+
if (queryParams.token_type &&queryParams.access_token ) {
53+
oauth2.callback({token_type: queryParams.token_type, access_token: queryParams.access_token});
54+
} else {
55+
oauth2.error({
56+
level: 'error',
57+
message: 'Authorization failed: no accessToken received from the server'
58+
});
59+
}
60+
} else {
61+
oauth2.error({
62+
level: 'error',
63+
message: 'Authorization failed'
64+
});
65+
}
66+
window.close();
67+
}
68+
</script>

0 commit comments

Comments
 (0)