From f5d6f24b30bbfa9370ab683d75274132e2fdb67a Mon Sep 17 00:00:00 2001 From: Aine Date: Mon, 7 Oct 2024 12:00:33 +0300 Subject: [PATCH] correctly treat empty or "almost empty" restrictBaseUrl config option, fixes #56 --- src/pages/LoginPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/LoginPage.tsx b/src/pages/LoginPage.tsx index 9ffafd9..e0fbb09 100644 --- a/src/pages/LoginPage.tsx +++ b/src/pages/LoginPage.tsx @@ -88,7 +88,7 @@ const LoginPage = () => { const notify = useNotify(); const { restrictBaseUrl } = useAppContext(); const allowSingleBaseUrl = typeof restrictBaseUrl === "string"; - const allowMultipleBaseUrls = Array.isArray(restrictBaseUrl); + const allowMultipleBaseUrls = (Array.isArray(restrictBaseUrl) && restrictBaseUrl.length > 0 && restrictBaseUrl[0] !== "" && restrictBaseUrl[0] !== null); const allowAnyBaseUrl = !(allowSingleBaseUrl || allowMultipleBaseUrls); const [loading, setLoading] = useState(false); const [supportPassAuth, setSupportPassAuth] = useState(true);