From 3932eed8591d737598080967041ca2c306765c4e Mon Sep 17 00:00:00 2001 From: Urtzi Alfaro Date: Fri, 18 Jul 2025 17:14:30 +0200 Subject: [PATCH] Fix token issue 2 --- README.md | 2 +- gateway/app/core/config.py | 2 +- services/auth/README.md | 2 +- services/auth/app/api/auth.py | 2 +- services/auth/app/core/config.py | 2 +- services/auth/docker-compose.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6beb41f4..8817bb45 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ SMTP_PASSWORD=your-email-password WHATSAPP_API_KEY=your-whatsapp-api-key # JWT Secret (change in production!) -JWT_SECRET_KEY=your-super-secret-jwt-key +JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production ``` ## Troubleshooting diff --git a/gateway/app/core/config.py b/gateway/app/core/config.py index f4d587d0..eef93ca1 100644 --- a/gateway/app/core/config.py +++ b/gateway/app/core/config.py @@ -44,7 +44,7 @@ class Settings(BaseSettings): RATE_LIMIT_WINDOW: int = 60 # JWT settings - JWT_SECRET_KEY: str = "your-secret-key-change-in-production" + JWT_SECRET_KEY: str = "your-super-secret-jwt-key-change-in-production" JWT_ALGORITHM: str = "HS256" @property diff --git a/services/auth/README.md b/services/auth/README.md index bfbd3101..51754588 100644 --- a/services/auth/README.md +++ b/services/auth/README.md @@ -72,7 +72,7 @@ Set these environment variables: DATABASE_URL=postgresql+asyncpg://auth_user:auth_pass123@auth-db:5432/auth_db REDIS_URL=redis://redis:6379/0 RABBITMQ_URL=amqp://bakery:forecast123@rabbitmq:5672/ -JWT_SECRET_KEY=your-super-secret-jwt-key +JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production JWT_ACCESS_TOKEN_EXPIRE_MINUTES=30 JWT_REFRESH_TOKEN_EXPIRE_DAYS=7 MAX_LOGIN_ATTEMPTS=5 diff --git a/services/auth/app/api/auth.py b/services/auth/app/api/auth.py index b3fb55c9..2f179e84 100644 --- a/services/auth/app/api/auth.py +++ b/services/auth/app/api/auth.py @@ -156,7 +156,7 @@ async def verify_token( ) token = auth_header.split(" ")[1] - payload = await AuthService.verify_token(token, db) + payload = await AuthService.verify_token(token) # Record successful verification if metrics: diff --git a/services/auth/app/core/config.py b/services/auth/app/core/config.py index a35c9a9a..c6b7da5a 100644 --- a/services/auth/app/core/config.py +++ b/services/auth/app/core/config.py @@ -21,7 +21,7 @@ class Settings(BaseSettings): REDIS_URL: str = os.getenv("REDIS_URL", "redis://redis:6379/0") # JWT settings - JWT_SECRET_KEY: str = os.getenv("JWT_SECRET_KEY", "your-super-secret-jwt-key") + JWT_SECRET_KEY: str = os.getenv("JWT_SECRET_KEY", "your-super-secret-jwt-key-change-in-production") JWT_ALGORITHM: str = os.getenv("JWT_ALGORITHM", "HS256") JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = int(os.getenv("JWT_ACCESS_TOKEN_EXPIRE_MINUTES", "30")) JWT_REFRESH_TOKEN_EXPIRE_DAYS: int = int(os.getenv("JWT_REFRESH_TOKEN_EXPIRE_DAYS", "7")) diff --git a/services/auth/docker-compose.yml b/services/auth/docker-compose.yml index 7a9bcc2c..55c583cc 100644 --- a/services/auth/docker-compose.yml +++ b/services/auth/docker-compose.yml @@ -53,7 +53,7 @@ services: - DATABASE_URL=postgresql+asyncpg://auth_user:auth_pass123@auth-db:5432/auth_db - REDIS_URL=redis://redis:6379/0 - RABBITMQ_URL=amqp://bakery:forecast123@rabbitmq:5672/ - - JWT_SECRET_KEY=your-super-secret-jwt-key + - JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production - DEBUG=true - LOG_LEVEL=INFO ports: