file based auth

This commit is contained in:
2026-02-23 09:58:08 +00:00
parent 0bea406dcd
commit 2779fe22c6
40 changed files with 456 additions and 1010 deletions
@@ -1,10 +1,9 @@
import { createRouter } from '../../create-router';
import { officerdb, count, Users } from 'officerdb';
import { getUserCount } from 'officerdb';
export const landingPageDataRouter = createRouter();
landingPageDataRouter.get('/', async (ctx) => {
const result = await officerdb.select({ count: count() }).from(Users);
const userCount = result[0]?.count ?? 0;
const userCount = getUserCount();
return ctx.json({ registrationOpen: userCount === 0 });
});