feat: switch to use apiBase rather than instanceUrl for checking stats endpoint

This commit is contained in:
SauceyRed 2025-05-31 02:38:18 +02:00
parent bb63afa31e
commit 7bbf905df5
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

View file

@ -39,11 +39,11 @@ const form = reactive({
const query = useRoute().query as Record<string, string>;
const searchParams = new URLSearchParams(query);
const instanceUrl = useCookie("instance_url").value;
const registrationEnabled = ref<boolean>(true);
const apiBase = useCookie("api_base");
if (instanceUrl) {
const statsUrl = new URL("/stats", instanceUrl).href;
if (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;