Skip to content

Fix: environment variable validation for MONGO_URI and JWT_SECRET#1674

Open
dhruvdeepChakravorty wants to merge 1 commit into
aryandas2911:mainfrom
dhruvdeepChakravorty:fix/env-validation
Open

Fix: environment variable validation for MONGO_URI and JWT_SECRET#1674
dhruvdeepChakravorty wants to merge 1 commit into
aryandas2911:mainfrom
dhruvdeepChakravorty:fix/env-validation

Conversation

@dhruvdeepChakravorty

@dhruvdeepChakravorty dhruvdeepChakravorty commented Jun 30, 2026

Copy link
Copy Markdown

📌 Description

I added validations for JWT_SECRET and MONGO_URI using filter method.

🔗 Related Issue

Closes #1671

🛠 Changes Made

  • Added validations in server.js file for JWT_SECRET and MONGO_URI

✅ Checklist

  • [✅ ] Code runs locally
  • [ ✅] Followed project structure
  • No console errors
  • [ ✅] Properly tested changes
  • [ ✅] Linked the issue

🚀 Notes for Reviewers

While setting up the project, I noticed that TWO_FACTOR_ENCRYPTION_KEY is required by authController.js, but it is not documented in .env.example.

As a result, a fresh clone of the project fails to start until contributors manually discover and add this environment variable. It may be worth adding it to .env.example or handling its validation during application startup instead of at the module level .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant