feat: switch to use fetcvhInstanceStats from api in login page to check for whether registration is enabled

This commit is contained in:
SauceyRed 2025-07-09 07:28:18 +02:00
parent 9f66643b99
commit 2863651f70
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

View file

@ -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<StatsResponse>(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;
}
}