1
0
Fork 0

Secure sockets listener for login or not login user

This commit is contained in:
Ethanell 2020-11-02 17:22:50 +01:00
parent 6477d8e074
commit c4314c2678

View file

@ -1,10 +1,13 @@
module.exports = socket => {
console.log("New connection !");
if (!socket.request.session.user) {
socket.on("login", require("./login")(socket));
socket.on("register", require("./register")(socket));
socket.on("checkResend", require("./email/checkResend")(socket));
socket.on("forgotPassword", require("./email/forgotPassword")(socket));
socket.on("setPassword", require("./email/setPassword")(socket));
} else {
socket.on("profileEdit", require("./profile/edit")(socket));
}
socket.emit("connected");
}