From 7ccdbace705d83114192ff81d8782619d710f6af Mon Sep 17 00:00:00 2001 From: Divya Jagadish Date: Wed, 30 Mar 2022 11:33:21 -0700 Subject: [PATCH] Authenticate ping API --- lib/ui/api.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ui/api.ts b/lib/ui/api.ts index 4e43a73..b3d4178 100644 --- a/lib/ui/api.ts +++ b/lib/ui/api.ts @@ -660,6 +660,7 @@ router.post("/devices/:id/tags", async (ctx) => { }); router.get("/ping/:host", async (ctx) => { + if (!ctx.state.user) return void (ctx.status = 401); return new Promise((resolve) => { ping(ctx.params.host, (err, parsed) => { if (parsed) {