build fix

This commit is contained in:
2026-03-23 16:28:35 -05:00
parent 6659707890
commit c88242bf22
2 changed files with 4 additions and 12 deletions

View File

@@ -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
) {

View File

@@ -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" ||