Summary
Several env vars referenced in authController.js are missing from backend/.env.example, causing fresh clones to crash on startup.
Missing Variables
-
TWO_FACTOR_ENCRYPTION_KEY - Crashes on startup
authController.js (line 15, 24-26) does a module-level throw if this is missing or invalid. This crashes the entire server at import time. Not documented in .env.example.
-
JWT_ALGORITHM - Undocumented
Defaults to HS256 but no env.example entry exists.
-
AUTH_COOKIE_DOMAIN / COOKIE_DOMAIN - Undocumented
Used for setting cookie domain in production, not mentioned anywhere in .env.example.
Proposed Fix
Add these vars to backend/.env.example with comments.
Replace the module-level throw with graceful startup validation.
Acceptance Criteria
- TWO_FACTOR_ENCRYPTION_KEY added to .env.example with generation instructions
- JWT_ALGORITHM added to .env.example
- AUTH_COOKIE_DOMAIN added to .env.example
- Module-level throw replaced with friendly startup error
Summary
Several env vars referenced in authController.js are missing from backend/.env.example, causing fresh clones to crash on startup.
Missing Variables
TWO_FACTOR_ENCRYPTION_KEY - Crashes on startup
authController.js (line 15, 24-26) does a module-level throw if this is missing or invalid. This crashes the entire server at import time. Not documented in .env.example.
JWT_ALGORITHM - Undocumented
Defaults to HS256 but no env.example entry exists.
AUTH_COOKIE_DOMAIN / COOKIE_DOMAIN - Undocumented
Used for setting cookie domain in production, not mentioned anywhere in .env.example.
Proposed Fix
Add these vars to backend/.env.example with comments.
Replace the module-level throw with graceful startup validation.
Acceptance Criteria