forked from caseyw727/papertek.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oauthComplete.html
111 lines (97 loc) · 2.53 KB
/
oauthComplete.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
---
permalink: /oauthComplete.html
title: Discord OAuth Complete
layout: none
---
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta tags defines metadata for an HTML document -->
<meta charset="UTF-8" />
<!-- Helps with small smart devices so site could be sane -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/assets/images/caramel.png" />
<!-- Page title CSS, and Scripts -->
<link rel="stylesheet" href= "{{ "assets/css/styles.css" | relative_url }}?v={{ site.time | date:'%s' }}" />
<title>{{page.title}} | {{site.title}}</title>
<style>
body,
h1 {
font-weight: 400;
font-display: swap;
font-style: normal;
}
#container {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
align-items: center;
}
.buttonDefault {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
#top,
#top * {
vertical-align: middle;
}
#top img {
width: 54px;
margin-right: 12px;
}
#top span {
font-size: 42px;
}
#bottom p {
font-size: 18px;
}
#bottom img {
width: 128px;
}
</style>
<!-- Stupid thing that should prevent the page from fully loading -->
<script>
// if (!window.location.search || (window.location.search ? new URLSearchParams(window.location.search).get("code") == null : false))
if (!window.location.hash)
window.location.href = "/"; // Redirect to home page.
</script>
</head>
<!-- Main body of the page -->
<body>
<div id="container">
<div id="top">
<h1><img src="/assets/images/caramel.png" /><span>Camellia • Wiki</span></h1>
</div>
<div> </div>
<div id="bottom">
<p id="txt">OAuth Complete.</p>
<br />
<p>If you are not redirected, please try again.</p>
<br />
</div>
</div>
</body>
</html>
<script>
var hash = window.location.hash;
var split = hash.replace("#", "").split("&");
var token = "";
for (var i = 0; i < split.length; i++) {
var key = split[i];
var split2 = key.split("=");
if (split2[0] == "access_token") {
token = split2[1];
};
};
window.addEventListener("message", (event) => {
event.source.postMessage({
token
});
});
</script>