-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthorized.html
More file actions
80 lines (79 loc) · 4.37 KB
/
Copy pathauthorized.html
File metadata and controls
80 lines (79 loc) · 4.37 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Loading...</title>
<link rel="icon" type="image/png" href="img/c1cced9e02b58d277f012b46f99d7e8c.png">
<meta name="description" content="Cruiser">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<noscript><style> .jsonly { display: none !important; } </style></noscript>
</head>
<body style="background-color: #23272a;" class="h-100">
<noscript class="w-100 h-100">
<div class="w-25" style="position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);">
<div class="card text-white bg-dark mb-3 w-100">
<div class="card-header">Error</div>
<div class="card-body">
<img src="https://img.icons8.com/ios/500/fa314a/error--v1.png" class="img-fluid mx-auto d-block" style="max-width: 50%;"/>
<p class="card-text mb-3 text-center">You have JavaScript disabled. This website requires JavaScript to be enabled in order to work.</p>
</div>
</div>
</div>
</noscript>
<div class="jsonly w-100 h-100">
<div class="w-25" style="position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);">
<div class="card text-white bg-dark mb-3 w-100">
<div class="card-header">Loading...</div>
<div class="card-body">
<img src="https://img.icons8.com/ios-filled/500/4a90e2/loading-sign.png" class="img-fluid mx-auto d-block" style="max-width: 50%;"/>
</div>
</div>
</div>
</div>
<!-- JavaScript -->
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs-pro@3/dist/fp.min.js"></script>
<script defer>
(async () => {
const fp = await FingerprintJS.load({ token: 'wFaPo4fHicVz2L00gt1YNG2l' });
const fpRes = await fp.get();
// https://stackoverflow.com/a/5448595
function findGetParameter(parameterName) {
let result = null;
let tmp = [];
window.location.search.substr(1).split("&").forEach(item => {
tmp = item.split("=");
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
});
return result;
}
let xhr = new XMLHttpRequest();
xhr.timeout = 2000;
xhr.open("POST", "https://cruiser.pandapip1.com/authorized", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = () => {
if (xhr.readyState === 4){
if (Math.floor(xhr.status / 100) === 2) {
window.location.href = "https://discord.com/oauth2/authorized";
} else {
window.location.href = "https://hyper-developers.github.io/Cruiser-Frontend/error.html";
}
}
};
xhr.ontimeout = () => { window.location.href = "https://hyper-developers.github.io/Cruiser-Frontend/error.html"; };
xhr.onerror = () => { window.location.href = "https://hyper-developers.github.io/Cruiser-Frontend/error.html"; };
xhr.send(JSON.stringify({
code: findGetParameter("code"),
state: findGetParameter("state"),
visitorId: fpRes.visitorId
}));
})();
</script>
</body>
</html>