Spaces:
Sleeping
Sleeping
| """ | |
| Authentication Middleware | |
| """ | |
| from fastapi import Request, HTTPException | |
| from starlette.middleware.base import BaseHTTPMiddleware | |
| from src.api.core.logger import logger | |
| class AuthMiddleware(BaseHTTPMiddleware): | |
| """Simple authentication middleware""" | |
| async def dispatch(self, request: Request, call_next): | |
| # Skip auth for health endpoints | |
| if request.url.path in ["/", "/api/health"]: | |
| return await call_next(request) | |
| # TODO: Implement Firebase auth token verification | |
| # For now, allow all requests | |
| response = await call_next(request) | |
| return response | |