-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth.html
74 lines (63 loc) · 1.97 KB
/
auth.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
margin: 8 12 28;
}
code {
white-space: pre-line;
}
html {
overflow-wrap: anywhere;
zoom: 1.8;
color-scheme: dark;
background-image: radial-gradient(at top, #575757, black);
font-family: arial;
text-align: center;
color-scheme: dark;
}
button:not([class]), textarea:not([class]), input:not([class]), a:not([class]) {
border-radius: 0;
margin: 0.2rem 0.0rem;
width: 100%;
zoom: 1.2;
resize: vertical;
}
</style>
<title>Auth</title>
<body style="
display: flex;
align-items: center;
justify-content: center;
">
<div>
<h3 style="user-select: none;">Copy the code below and paste it to input filed in game</h3>
<h2 id="code-display" style="
filter: drop-shadow(4px 4px 2px black);
border: lightgray;
border-style: dotted;
padding: 6px;
user-select: all;
cursor: pointer;
font-size: 100%;
"></h2>
</div>
<script type="text/javascript">
function getParameterByName(name) {
name = name.replace(/[$$]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(window.location.href);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var code = getParameterByName('code');
if (code) {
document.getElementById('code-display').innerText = code;
}
else {
var client_id = "Ov23lisVe58mXL4UNOsE";
var redirect_url = "https://github.com/login/oauth/authorize?client_id=" + client_id + "&scope=public_repo,notifications";
window.location.href = redirect_url;
}
</script>