feature/IO-2776-cdk-fortellis - Cleanup + Auth Socket stuff

This commit is contained in:
Dave
2025-09-24 18:12:57 -04:00
parent 57baa3d9fd
commit f7799ffd03
6 changed files with 492 additions and 387 deletions

View File

@@ -9,7 +9,6 @@ const { PbsCalculateAllocationsAp, PbsExportAp } = require("../accounting/pbs/pb
const { createLogEvent } = require("./createLogEvent");
function SetLegacyWebsocketHandlers(io) {
io.use(function (socket, next) {
try {
if (socket.handshake.auth.token) {
@@ -53,6 +52,7 @@ function SetLegacyWebsocketHandlers(io) {
socket.on("cdk-export-job", (jobid) => {
CdkJobExport(socket, jobid);
});
socket.on("cdk-selected-customer", (selectedCustomerId) => {
createLogEvent(socket, "DEBUG", `User selected customer ID ${selectedCustomerId}`);
socket.selectedCustomerId = selectedCustomerId;
@@ -116,7 +116,6 @@ function SetLegacyWebsocketHandlers(io) {
createLogEvent(socket, "DEBUG", `User disconnected.`);
});
});
}
exports.SetLegacyWebsocketHandlers = SetLegacyWebsocketHandlers;
exports.SetLegacyWebsocketHandlers = SetLegacyWebsocketHandlers;