Skip to content

Commit 1b18429

Browse files
Avoid using Facebook garbage fragment to complete login
Facebook adds a nonsense fragment to all redirect URIs when returning a code. This stops a fragments being surreptitiously passed through the authorization flow. See http://stackoverflow.com/questions/7131909/facebook-callback-appends-to-return-url Before this change, the presence of Facebook's garbage fragment would break the Swagger UI complete page, as having any fragment value at all will cause the complete page to ignore the query string. This change avoids using the fragment if it looks to be useless.
1 parent bf60526 commit 1b18429

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/html/o2c.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script>
22
var qp = null;
3-
if(window.location.hash) {
3+
if(window.location.hash && window.location.hash !== "#_=_") {
44
qp = location.hash.substring(1);
55
}
66
else {
@@ -17,4 +17,4 @@
1717
window.opener.onOAuthComplete(qp);
1818

1919
window.close();
20-
</script>
20+
</script>

0 commit comments

Comments
 (0)