feat: basic admin interface

This commit is contained in:
Zoe
2026-10-08 13:41:02 -05:00
parent 7b0800882a
commit f6e1bc1f47
27 changed files with 4095 additions and 49 deletions
+7 -2
View File
@@ -12,9 +12,10 @@ if (session.value !== null) {
await navigateTo(to ?? '/');
}
const config = useRuntimeConfig();
// who may register is an instance setting, admins change it while it runs
const { data: instance } = await useFetch('/api/instance', { key: 'instance' });
if (config.public.disableSignup) {
if (instance.value && instance.value.registration !== 'open') {
await navigateTo(to ? `/auth/login?to=${to}` : '/auth/login');
}
@@ -121,6 +122,10 @@ const submit = async () => {
passwordInputEl.value!.setCustomValidity(res.error.data.message!);
passwordInputEl.value!.reportValidity();
break;
case 'REGISTRATION_CLOSED':
// an admin closed registration while this page was open
alert('Registration is closed on this instance. Ask an admin for an account.');
break;
default:
console.log(res.error);
alert('Something went wrong: ' + res.error.data.message);