added auto disconnect when changing link

This commit is contained in:
PxlLoewe
2025-06-02 15:04:15 -07:00
parent 72998a36a4
commit af36b82221
9 changed files with 72 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ export const handleConnectPilot =
(socket: Socket, io: Server) =>
async ({ logoffTime, stationId }: { logoffTime: string; stationId: string }) => {
try {
if (!stationId) return Error("Station ID is required");
const user: User = socket.data.user; // User ID aus dem JWT-Token
const userId = socket.data.user.id; // User ID aus dem JWT-Token