Application fully migrated to modular approach

This commit is contained in:
2025-09-13 21:30:40 +02:00
parent c7d6b33cd5
commit b9fe91ab88
38 changed files with 509 additions and 265 deletions

View File

@@ -6,7 +6,8 @@ from models.database_models import User, Shop
from middleware.auth import AuthManager
from middleware.rate_limiter import RateLimiter
security = HTTPBearer()
# Set auto_error=False to prevent automatic 403 responses
security = HTTPBearer(auto_error=False)
auth_manager = AuthManager()
rate_limiter = RateLimiter()
@@ -16,6 +17,10 @@ def get_current_user(
db: Session = Depends(get_db)
):
"""Get current authenticated user"""
# Check if credentials are provided
if not credentials:
raise HTTPException(status_code=401, detail="Authorization header required")
return auth_manager.get_current_user(db, credentials)