From c88242bf22c14aa4653b31735948e16ca5415afe Mon Sep 17 00:00:00 2001 From: jason Date: Mon, 23 Mar 2026 16:28:35 -0500 Subject: [PATCH] build fix --- lib/auth.ts | 14 +++----------- middleware.ts => proxy.ts | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) rename middleware.ts => proxy.ts (97%) diff --git a/lib/auth.ts b/lib/auth.ts index c9977b9..74809d3 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -1,3 +1,4 @@ +import type Database from "better-sqlite3"; import crypto from "node:crypto"; import { cookies } from "next/headers"; import { redirect } from "next/navigation"; @@ -62,12 +63,7 @@ function decodeSession(value: string | undefined): SessionPayload | null { } } -export function bootstrapAdminUser(db: { - prepare: (sql: string) => { - get: (...args: unknown[]) => unknown; - run: (...args: unknown[]) => unknown; - }; -}) { +export function bootstrapAdminUser(db: Database.Database) { const countRow = db.prepare(`SELECT COUNT(*) AS count FROM users`).get() as { count: number }; if ((countRow.count ?? 0) > 0) { @@ -121,11 +117,7 @@ export async function destroySession() { } export function authenticateUser( - db: { - prepare: (sql: string) => { - get: (...args: unknown[]) => unknown; - }; - }, + db: Database.Database, email: string, password: string ) { diff --git a/middleware.ts b/proxy.ts similarity index 97% rename from middleware.ts rename to proxy.ts index 9c552eb..f553c9a 100644 --- a/middleware.ts +++ b/proxy.ts @@ -47,7 +47,7 @@ async function hasValidSession(request: NextRequest) { } } -export async function middleware(request: NextRequest) { +export async function proxy(request: NextRequest) { const { pathname } = request.nextUrl; const isPublic = pathname === "/login" ||