26 lines
No EOL
419 B
JavaScript
26 lines
No EOL
419 B
JavaScript
let socket = io.connect();
|
|
/*
|
|
Front-end Event
|
|
*/
|
|
// Disconnect
|
|
document.getElementById("logout").addEventListener("click", function() {
|
|
socket.emit("logout")
|
|
});
|
|
|
|
|
|
/*
|
|
Socket Actions
|
|
*/
|
|
// Disconnect
|
|
socket.on("logout", data=>{
|
|
if(data.error){
|
|
alert(data.error.message);
|
|
}else{
|
|
window.location.href = "/";
|
|
}
|
|
})
|
|
|
|
|
|
function profilRedirect(){
|
|
document.location.href="/profil";
|
|
} |