mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-02-08 04:21:18 -05:00
15 lines
351 B
TypeScript
15 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();
|