feat: setup and roles

This commit is contained in:
Zoe
2026-10-08 13:08:20 -05:00
parent 4bba529ba8
commit 7b0800882a
13 changed files with 3502 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
import { users } from '~~/drizzle/schema';
import { db } from '~~/server/lib/db';
/**
* An instance needs setting up for as long as it has no accounts. The first
* account is created by the setup page and becomes the admin.
*/
export const isSetupNeeded = async (): Promise<boolean> => {
const existing = await db.select({ id: users.id }).from(users).limit(1);
return existing.length === 0;
};