Fix token issue 2

This commit is contained in:
Urtzi Alfaro
2025-07-18 17:14:30 +02:00
parent e92ccb8e0a
commit 3932eed859
6 changed files with 6 additions and 6 deletions

View File

@@ -85,7 +85,7 @@ SMTP_PASSWORD=your-email-password
WHATSAPP_API_KEY=your-whatsapp-api-key WHATSAPP_API_KEY=your-whatsapp-api-key
# JWT Secret (change in production!) # 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 ## Troubleshooting

View File

@@ -44,7 +44,7 @@ class Settings(BaseSettings):
RATE_LIMIT_WINDOW: int = 60 RATE_LIMIT_WINDOW: int = 60
# JWT settings # 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" JWT_ALGORITHM: str = "HS256"
@property @property

View File

@@ -72,7 +72,7 @@ Set these environment variables:
DATABASE_URL=postgresql+asyncpg://auth_user:auth_pass123@auth-db:5432/auth_db DATABASE_URL=postgresql+asyncpg://auth_user:auth_pass123@auth-db:5432/auth_db
REDIS_URL=redis://redis:6379/0 REDIS_URL=redis://redis:6379/0
RABBITMQ_URL=amqp://bakery:forecast123@rabbitmq:5672/ 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_ACCESS_TOKEN_EXPIRE_MINUTES=30
JWT_REFRESH_TOKEN_EXPIRE_DAYS=7 JWT_REFRESH_TOKEN_EXPIRE_DAYS=7
MAX_LOGIN_ATTEMPTS=5 MAX_LOGIN_ATTEMPTS=5

View File

@@ -156,7 +156,7 @@ async def verify_token(
) )
token = auth_header.split(" ")[1] token = auth_header.split(" ")[1]
payload = await AuthService.verify_token(token, db) payload = await AuthService.verify_token(token)
# Record successful verification # Record successful verification
if metrics: if metrics:

View File

@@ -21,7 +21,7 @@ class Settings(BaseSettings):
REDIS_URL: str = os.getenv("REDIS_URL", "redis://redis:6379/0") REDIS_URL: str = os.getenv("REDIS_URL", "redis://redis:6379/0")
# JWT settings # 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_ALGORITHM: str = os.getenv("JWT_ALGORITHM", "HS256")
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = int(os.getenv("JWT_ACCESS_TOKEN_EXPIRE_MINUTES", "30")) 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")) JWT_REFRESH_TOKEN_EXPIRE_DAYS: int = int(os.getenv("JWT_REFRESH_TOKEN_EXPIRE_DAYS", "7"))

View File

@@ -53,7 +53,7 @@ services:
- DATABASE_URL=postgresql+asyncpg://auth_user:auth_pass123@auth-db:5432/auth_db - DATABASE_URL=postgresql+asyncpg://auth_user:auth_pass123@auth-db:5432/auth_db
- REDIS_URL=redis://redis:6379/0 - REDIS_URL=redis://redis:6379/0
- RABBITMQ_URL=amqp://bakery:forecast123@rabbitmq:5672/ - 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 - DEBUG=true
- LOG_LEVEL=INFO - LOG_LEVEL=INFO
ports: ports: