1
0
mirror of https://dev.s-ul.net/Galexion/MaiMaiDXNet.git synced 2024-11-24 07:00:16 +01:00
MaiMaiDXNet/views/user.ejs
2023-02-16 18:50:32 -05:00

28 lines
1.1 KiB
Plaintext

<% var rootPath='../' ; %>
<%- include(rootPath + 'templates/header.ejs' ); %>
<h1>Yo! Welcome Back ${User}!</h1>
<button id="clear-storage-btn">Sign Out</button>
<script>
const extId = localStorage.getItem('ext_id');
const luid = localStorage.getItem('luid');
if (extId === null || luid === null) {
console.log('User Data Not Detected! Please Sign In.');
window.location = "/";
} else {
console.log(`User Data Found!`);
}
const clearStorageBtn = document.getElementById('clear-storage-btn');
clearStorageBtn.addEventListener('click', () => {
localStorage.removeItem('ext_id');
localStorage.removeItem('luid');
console.log('Local storage cleared.');
window.location = "/";
});
</script>
<details>
<summary>Developer Only Information</summary>
For Development purposes only, send statistics found in this menu when encontering UI Errors.
</details>