2013-04-11 22:38:41 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function getParameter(name) {
|
|
|
|
var regex = new RegExp(name + "=(.+?)(&|$)");
|
|
|
|
try {
|
|
|
|
return decodeURI(regex.exec(location.search)[1]);
|
|
|
|
} catch (e) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var client_id = getParameter("client_id");
|
2013-12-27 21:12:04 +00:00
|
|
|
var scope = getParameter("scope") || 'repo,gist';
|
2013-04-11 22:38:41 +00:00
|
|
|
var code = getParameter("code");
|
2013-04-12 23:09:34 +00:00
|
|
|
if (client_id) {
|
2013-04-11 22:38:41 +00:00
|
|
|
window.location.href = "https://github.com/login/oauth/authorize?client_id="
|
2013-12-27 21:12:04 +00:00
|
|
|
+ client_id + "&scope=" + scope;
|
2013-04-12 23:09:34 +00:00
|
|
|
} else {
|
|
|
|
if (code) {
|
|
|
|
localStorage["githubCode"] = code;
|
|
|
|
}
|
|
|
|
window.close();
|
2013-04-11 22:38:41 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
</html>
|