-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.html
39 lines (37 loc) · 865 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<title>auth</title>
</head>
<body>
authing...
<script type="text/javascript">
</script>
<script type="text/javascript">
(function () {
var req = new XMLHttpRequest()
req.onload = function () {
if (req.status === 404) {
alert("404")
} else {
var infoObj = JSON.parse(req.response);
var name = infoObj.login;
var image = infoObj.avatar_url;
document.cookie = "name=" + name + "; path=/fuckexperience";
document.cookie = "image=" + image + "; path=/fuckexperience";
// alert(document.cookie)
localStorage.setItem('login', true);
// localStorage
// localStorage.setItem('image', image);
// alert(document.cookie)
}
window.close();
}
var search = location.search;
var url = '/fuckexperience/api/github/accessToken'+search
req.open('GET', url)
req.send()
})()
</script>
</body>
</html>