fix: refuse to start if JWT_SECRET is not set in environment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5de1174363
commit
82a094f2f2
|
|
@ -83,10 +83,11 @@ function escapeHtml(str) {
|
|||
}
|
||||
|
||||
// ── Auth: JWT config ────────────────────────────────────────────────
|
||||
const JWT_SECRET = process.env.JWT_SECRET || 'dev-secret-CHANGE-IN-PRODUCTION';
|
||||
if (!process.env.JWT_SECRET) {
|
||||
console.error('[SECURITY] JWT_SECRET is not set. Using insecure default. Set JWT_SECRET env var in production!');
|
||||
console.error('[SECURITY] JWT_SECRET env var is not set. Refusing to start.');
|
||||
process.exit(1);
|
||||
}
|
||||
const JWT_SECRET = process.env.JWT_SECRET;
|
||||
const JWT_TTL_SECONDS = 30 * 24 * 60 * 60; // 30 days
|
||||
|
||||
// WebAuthn relying party config (from env)
|
||||
|
|
|
|||
Loading…
Reference in New Issue