From 2863651f7031d686decac8262cddca018ffdf788 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Wed, 9 Jul 2025 07:28:18 +0200 Subject: [PATCH] feat: switch to use fetcvhInstanceStats from api in login page to check for whether registration is enabled --- pages/login.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pages/login.vue b/pages/login.vue index c7f4cbc..03078c3 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -44,10 +44,9 @@ const apiBase = useCookie("api_base"); if (apiBase.value) { console.log("apiBase:", apiBase.value); - const statsUrl = new URL("/stats", apiBase.value).href; - const { status, data } = await useFetch(statsUrl); - if (status.value == "success" && data.value) { - registrationEnabled.value = data.value.registration_enabled; + const stats = await useApi().fetchInstanceStats(apiBase.value); + if (stats) { + registrationEnabled.value = stats.registration_enabled; } }