Changed most data storage to server-side

This commit is contained in:
ION606
2022-08-12 20:01:29 -07:00
parent 3ab442002d
commit c8b3d9b885
10 changed files with 457 additions and 317 deletions
+9 -2
View File
@@ -152,7 +152,7 @@
<script>
window.onload = () => {
if (!window.localStorage.getItem('serverInfo')) {
if (!window.localStorage.getItem('sessionId')) {
document.getElementById('guildslink').href = '';
document.getElementById('guildslink').style = 'cursor: no-drop;';
@@ -164,7 +164,14 @@
function logout() {
window.localStorage.clear();
window.location.href = 'index.html';
window.sessionStorage.clear();
var xhr = new XMLHttpRequest();
xhr.open('post', 'http://www.selmerbot.com/logout/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionid', window.localStorage.getItem('sessionId'));
xhr.onloadend = (e) => { window.location.href = 'index.html'; }
xhr.send();
}
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! http://www.selmerbot.com/ -->