forked from basicallydan/forkability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github.html
22 lines (22 loc) · 787 Bytes
/
github.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!-- This file is here just for the purposes of the gh-pages branch to
allow the 3rd-party oauth service (getapi.co) to work -->
<script type="text/javascript">
function getParameterByName(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
var accessToken = getParameterByName('accessToken');
var tokenType = getParameterByName('tokenType');
var scope = getParameterByName('scope');
if (window.opener) {
window.opener.window.useGitHubCodes({
accessToken: accessToken,
tokenType: tokenType,
scope: scope
});
} else {
alert('No parent window!');
}
</script>