zerobyte/app/server/modules/auth/auth.service.ts
2026-01-07 22:11:25 +01:00

14 lines
351 B
TypeScript

import { db } from "../../db/db";
import { usersTable } from "../../db/schema";
export class AuthService {
/**
* Check if any users exist in the system
*/
async hasUsers(): Promise<boolean> {
const [user] = await db.select({ id: usersTable.id }).from(usersTable).limit(1);
return !!user;
}
}
export const authService = new AuthService();