fix spamming from purgatory
This commit is contained in:
@@ -453,22 +453,25 @@ export async function handleWebSocketMessage(
|
|||||||
logger.info(`[purgatory] client ${resolvedId} is pending approval`);
|
logger.info(`[purgatory] client ${resolvedId} is pending approval`);
|
||||||
ws.send(encodeMessage({ type: "enrollment_status", status: "pending" }));
|
ws.send(encodeMessage({ type: "enrollment_status", status: "pending" }));
|
||||||
deps.notifyDashboard();
|
deps.notifyDashboard();
|
||||||
deps.notifyDashboardClientEvent("client_purgatory", {
|
const isNewPurgatoryEntry = !existing || existing.enrollmentStatus !== "pending";
|
||||||
id: resolvedId,
|
if (isNewPurgatoryEntry) {
|
||||||
host: _s((payload as any).host),
|
deps.notifyDashboardClientEvent("client_purgatory", {
|
||||||
user: _s((payload as any).user),
|
id: resolvedId,
|
||||||
os: _s((payload as any).os),
|
host: _s((payload as any).host),
|
||||||
ip: ip || undefined,
|
user: _s((payload as any).user),
|
||||||
country,
|
os: _s((payload as any).os),
|
||||||
});
|
ip: ip || undefined,
|
||||||
deps.broadcastClientEvent("client_purgatory", {
|
country,
|
||||||
id: resolvedId,
|
});
|
||||||
host: _s((payload as any).host),
|
deps.broadcastClientEvent("client_purgatory", {
|
||||||
user: _s((payload as any).user),
|
id: resolvedId,
|
||||||
os: _s((payload as any).os),
|
host: _s((payload as any).host),
|
||||||
ip: ip || undefined,
|
user: _s((payload as any).user),
|
||||||
country,
|
os: _s((payload as any).os),
|
||||||
});
|
ip: ip || undefined,
|
||||||
|
country,
|
||||||
|
});
|
||||||
|
}
|
||||||
setTimeout(() => { try { ws.close(4001, "pending"); } catch {} }, 100);
|
setTimeout(() => { try { ws.close(4001, "pending"); } catch {} }, 100);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user