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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue