feat: email+password auth with db-backed sessions

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
ahmed mohammed
2026-09-22 07:32:07 +03:00
co-authored by Claude Opus 4.7
parent 692ffa97c5
commit 5f8746cfae
13 changed files with 199 additions and 13 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ export const db = (g.__qaiDb ??= (() => {
})());
const now = () => Date.now();
const one = <T>(sql: string, ...p: unknown[]): T | null => (db.prepare(sql).get(...p) as T) ?? null;
type Row = string | number | null;
const one = <T>(sql: string, ...p: Row[]): T | null => (db.prepare(sql).get(...p) as T | undefined) ?? null;
// node:sqlite binds null/number/string/bigint/Buffer only: pass 0/1, never booleans.
export type SettingsInput = { analyst_base_url: string; analyst_key: string; analyst_model: string;