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

10 lines
292 B
JavaScript
Raw Permalink Normal View History

2020-11-03 12:54:40 +01:00
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"}});
}
}
2020-12-12 18:20:02 +01:00
};