Prod hardening and K8s drafts: auth fail-close, DB pool, init/schema split, prod init guard
This commit is contained in:
+4
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user