Skip to content

Commit 482dea8

Browse files
authored
refactor(oauth): put script tag in body (#6958)
1 parent 4db2edc commit 482dea8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

dist/oauth2-redirect.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<title>Swagger UI: OAuth2 Redirect</title>
55
</head>
66
<body>
7-
</body>
8-
</html>
97
<script>
108
'use strict';
119
function run () {
@@ -20,15 +18,15 @@
2018
qp = location.search.substring(1);
2119
}
2220

23-
arr = qp.split("&")
24-
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
21+
arr = qp.split("&");
22+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
2523
qp = qp ? JSON.parse('{' + arr.join() + '}',
2624
function (key, value) {
27-
return key === "" ? value : decodeURIComponent(value)
25+
return key === "" ? value : decodeURIComponent(value);
2826
}
29-
) : {}
27+
) : {};
3028

31-
isValid = qp.state === sentState
29+
isValid = qp.state === sentState;
3230

3331
if ((
3432
oauth2.auth.schema.get("flow") === "accessCode" ||
@@ -49,7 +47,7 @@
4947
oauth2.auth.code = qp.code;
5048
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
5149
} else {
52-
let oauthErrorMsg
50+
let oauthErrorMsg;
5351
if (qp.error) {
5452
oauthErrorMsg = "["+qp.error+"]: " +
5553
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
@@ -73,3 +71,5 @@
7371
run();
7472
});
7573
</script>
74+
</body>
75+
</html>

0 commit comments

Comments
 (0)