1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
letu/sockets/logout.js
2020-12-12 18:20:02 +01:00

10 lines
No EOL
292 B
JavaScript

module.exports = socket => {
return async (data) => {
if(socket.request.session.user){
socket.request.session.destroy();
socket.emit("logout", true);
}else{
socket.emit("logout", {error: { message: "not_logged_in"}});
}
}
};