Files
zerobyte/app/server/modules/auth/auth.service.ts
Nico 99932a8522 refactor: better-auth (#319)
* refactor: better-auth

* chore: pr feedback

* chore: lower + trim usernames in db
2026-01-07 22:36:20 +01:00

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();