|
|
@ -1,7 +1,3 @@
|
|
|
|
function deleteCookie(name) {
|
|
|
|
|
|
|
|
document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', async () => {
|
|
|
|
document.addEventListener('DOMContentLoaded', async () => {
|
|
|
|
const playerInfoDiv = document.getElementById('playerInfo');
|
|
|
|
const playerInfoDiv = document.getElementById('playerInfo');
|
|
|
|
|
|
|
|
|
|
|
@ -14,10 +10,8 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (response.status === 401) {
|
|
|
|
if (response.status === 401) {
|
|
|
|
deleteCookie('authToken');
|
|
|
|
|
|
|
|
window.location.href = '/';
|
|
|
|
window.location.href = '/';
|
|
|
|
} else if (!response.ok) {
|
|
|
|
} else if (!response.ok) {
|
|
|
|
deleteCookie('authToken');
|
|
|
|
|
|
|
|
playerInfoDiv.textContent = 'Error: Could not retrieve user information.';
|
|
|
|
playerInfoDiv.textContent = 'Error: Could not retrieve user information.';
|
|
|
|
window.location.href = '/';
|
|
|
|
window.location.href = '/';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|