-
Notifications
You must be signed in to change notification settings - Fork 3
/
oauth_redirect_home.html
56 lines (49 loc) · 1.37 KB
/
oauth_redirect_home.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
Logging In..
<body>
{{ script }}
<script>
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(";");
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == " ") {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
const red = getCookie("oauth_redirect");
const mini = "{{mini}}";
document.cookie =
"oauth_redirect" + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT;";
if (mini == "1") {
if (red != "") {
self.opener.location.replace(red, "_self");
alwaysLowered = true;
window.open("", "_self").close();
} else {
self.opener.location.replace("{{ redirect }}", "_self");
alwaysLowered = true;
window.open("", "_self").close();
}
} else {
window.location.replace("{{ redirect }}");
}
</script>
</body>
<!-- <script>
document.getElementById("demo").innerHTML =
"The full URL of this page is:<br>" + window.location.href;
const myTimeout = setTimeout(function () {
window.open(
"{{ auth_link }}",
"_blank",
"location=yes,height=570,width=520,scrollbars=yes,status=yes"
);
}, 5000);
</script> -->