Prod hardening and K8s drafts: auth fail-close, DB pool, init/schema split, prod init guard

This commit is contained in:
2026-06-27 20:41:41 -05:00
parent 744830c3cd
commit 49bf370d41
9 changed files with 346 additions and 257 deletions
+4 -1
View File
@@ -3,7 +3,10 @@ import { SignJWT, jwtVerify } from 'jose';
import bcrypt from 'bcryptjs';
import { db } from './db';
const JWT_SECRET = process.env.JWT_SECRET || 'change-me-in-production';
const JWT_SECRET = process.env.JWT_SECRET;
if (!JWT_SECRET) {
throw new Error('JWT_SECRET is not configured');
}
const secret = new TextEncoder().encode(JWT_SECRET);
export async function hashPassword(password: string) {