- add button logout when someone trying to connect to a account who already connected
This commit is contained in:
Kum1ta
2024-09-30 02:06:25 +02:00
parent 43c293c469
commit 50f1be0097

View File

@ -6,17 +6,28 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/22 23:33:18 by edbernar #+# #+# */ /* Created: 2024/09/22 23:33:18 by edbernar #+# #+# */
/* Updated: 2024/09/22 23:42:49 by edbernar ### ########.fr */ /* Updated: 2024/09/30 01:59:48 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
function typeErrorConnectedElsewhere() function typeErrorConnectedElsewhere()
{ {
const button = document.createElement('button');
button.type = 'button';
button.style.width = '10%';
button.style.color = 'black';
button.innerText = 'Log out';
button.addEventListener('click', () => window.location.href = '/logout');
setTimeout(() => { setTimeout(() => {
document.body.style.color = 'white'; document.body.style.color = 'white';
document.body.style.textAlign = 'center'; document.body.style.textAlign = 'center';
document.body.style.paddingTop = '10%'; document.body.style.paddingTop = '10%';
document.body.innerHTML = 'You are already connected somewhere...'; document.body.style.display = 'flex';
document.body.style.flexDirection = 'column';
document.body.style.alignItems = 'center';
document.body.innerHTML = 'You are already connected somewhere...<br/><br/>';
document.body.appendChild(button);
}, 500); }, 500);
} }