From fc69301fd1ac563cc03da6a44f2305f29588307a Mon Sep 17 00:00:00 2001 From: Will Norris Date: Mon, 11 Dec 2023 15:33:55 -0800 Subject: [PATCH] client/web: don't show login button if /ok errors When displaying the login client, we check for connectivity to the management client by calling it's /ok handler. If that response is non-200, then there is something wrong with the management client, so don't render the login button. Updates #10261 Signed-off-by: Will Norris --- client/web/src/components/login-toggle.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/web/src/components/login-toggle.tsx b/client/web/src/components/login-toggle.tsx index a1dbd3c95..08386d20e 100644 --- a/client/web/src/components/login-toggle.tsx +++ b/client/web/src/components/login-toggle.tsx @@ -106,9 +106,11 @@ function LoginPopoverContent({ } setIsRunningCheck(true) fetch(`http://${node.IPv4}:5252/ok`, { mode: "no-cors" }) - .then(() => { + .then((r) => { + if (r.ok) { + setCanConnectOverTS(true) + } setIsRunningCheck(false) - setCanConnectOverTS(true) }) .catch(() => setIsRunningCheck(false)) }, [auth.viewerIdentity, isRunningCheck, node.IPv4])