13 lines
572 B
JavaScript
13 lines
572 B
JavaScript
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");
|
|
}
|