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 crypto from "node:crypto";
import { cookies } from "next/headers"; import { cookies } from "next/headers";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
@@ -62,12 +63,7 @@ function decodeSession(value: string | undefined): SessionPayload | null {
} }
} }
export function bootstrapAdminUser(db: { export function bootstrapAdminUser(db: Database.Database) {
prepare: (sql: string) => {
get: (...args: unknown[]) => unknown;
run: (...args: unknown[]) => unknown;
};
}) {
const countRow = db.prepare(`SELECT COUNT(*) AS count FROM users`).get() as { count: number }; const countRow = db.prepare(`SELECT COUNT(*) AS count FROM users`).get() as { count: number };
if ((countRow.count ?? 0) > 0) { if ((countRow.count ?? 0) > 0) {
@@ -121,11 +117,7 @@ export async function destroySession() {
} }
export function authenticateUser( export function authenticateUser(
db: { db: Database.Database,
prepare: (sql: string) => {
get: (...args: unknown[]) => unknown;
};
},
email: string, email: string,
password: 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 { pathname } = request.nextUrl;
const isPublic = const isPublic =
pathname === "/login" || pathname === "/login" ||