feat: switch to use fetcvhInstanceStats from api in login page to check for whether registration is enabled
This commit is contained in:
parent
9f66643b99
commit
2863651f70
1 changed files with 3 additions and 4 deletions
|
@ -44,10 +44,9 @@ const apiBase = useCookie("api_base");
|
||||||
|
|
||||||
if (apiBase.value) {
|
if (apiBase.value) {
|
||||||
console.log("apiBase:", apiBase.value);
|
console.log("apiBase:", apiBase.value);
|
||||||
const statsUrl = new URL("/stats", apiBase.value).href;
|
const stats = await useApi().fetchInstanceStats(apiBase.value);
|
||||||
const { status, data } = await useFetch<StatsResponse>(statsUrl);
|
if (stats) {
|
||||||
if (status.value == "success" && data.value) {
|
registrationEnabled.value = stats.registration_enabled;
|
||||||
registrationEnabled.value = data.value.registration_enabled;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue