-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoauth.html
123 lines (108 loc) · 2.93 KB
/
oauth.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loading...</title>
<link rel="icon" type="image/png" href="./assets/images/engineerbo.png">
<style>
a,
span,
div,
body,
button,
input,
img,
form,
h1,
h2,
h3,
h4,
h5,
h6,
code {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-family: inherit;
font-size: 100%;
vertical-align: baseline;
}
body {
font-family: "Roboto", sans-serif;
background-color: #98dff3;
color: rgba(0, 0, 0, 0.96);
}
/* loading spiner */
.loader-container {
display: block;
margin: 1rem auto;
}
.loader {
border: 5px solid transparent;
border-radius: 50%;
border-top: 5px solid #fff;
border-right: 5px solid transparent;
border-bottom: 5px solid transparent;
width: 25px;
height: 25px;
margin: auto;
-webkit-animation: spin 0.4s linear infinite;
animation: spin 0.4s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div style="margin-top: 1.5rem;">
<div class="loader-container">
<div class="loader"></div>
</div>
</div>
<script>
function getAllUrlParams() {
var queries = location.search.slice(1).split("&");
var obj = {};
for (var i in queries) {
if (queries[i] != "") {
var tmp = queries[i].split("=");
obj[decodeURIComponent(tmp[0])] = decodeURIComponent(tmp[1]);
}
}
return obj;
}
window.onload = function () {
var state = getAllUrlParams().state
var session = getAllUrlParams().sess.trim()
if (state == "granted" && session !== "") {
localStorage.sess = session
location.href = "./"
} else if (state == "cancelled") {
location.href = "./"
} else {
alert("Failed to sign in.")
location.href = "./"
}
}
</script>
</body>
</html>