From 28a74ad0333e7cfa08b1d3d22da6a2df004f3fa1 Mon Sep 17 00:00:00 2001 From: "beetles-ai[bot]" <221859081+beetles-ai[bot]@users.noreply.github.com> Date: Sat, 4 Oct 2025 13:02:26 +0000 Subject: [PATCH] Patch for controllers/auth.py --- controllers/auth.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/auth.py b/controllers/auth.py index 080fdc1..5786c6a 100644 --- a/controllers/auth.py +++ b/controllers/auth.py @@ -30,7 +30,12 @@ class TokenResponse(BaseModel): auth_router = APIRouter() DEFAULT_STATUSES = ["BOOKMARKED", "APPLIED", "ACCEPTED", "REJECTED"] -JWT_SECRET = os.getenv('JWT_SECRET', 'your-secret-key') +import secrets +import sys +JWT_SECRET = os.getenv('JWT_SECRET') +if not JWT_SECRET: +print("CRITICAL: JWT_SECRET environment variable not set. Aborting.") +sys.exit(1) # Helper function to set JWT token async def create_token(user):