This commit is contained in:
2025-12-25 23:49:47 -07:00
parent 13821cbcd5
commit 0d608cf3f4
26 changed files with 7 additions and 94 deletions

View File

@@ -9,11 +9,9 @@ if (Astro.locals.user) {
return Astro.redirect('/dashboard');
}
// Check if this would be the first user
const userCountResult = await db.select({ count: count() }).from(users).get();
const isFirstUser = userCountResult ? userCountResult.count === 0 : true;
// Check if registration is enabled (only if not first user)
let registrationDisabled = false;
if (!isFirstUser) {
const registrationSetting = await db.select()