Commit f3b10a62 authored by Your Name's avatar Your Name

Fix: Exclude /auth/ paths from API authentication middleware

OAuth2 signup/login endpoints (/auth/oauth2/google, /auth/oauth2/github) now work correctly when API authentication is enabled. API authentication should only apply to LLM proxy endpoints, not authentication/signup routes.
parent ca0dc158
......@@ -1277,9 +1277,10 @@ async def shutdown_event():
async def auth_middleware(request: Request, call_next):
"""Check API token authentication if enabled"""
if server_config and server_config.get('auth_enabled', False):
# Skip auth for root endpoint, dashboard routes, admin API routes, favicon, and browser metadata
# Skip auth for root endpoint, dashboard routes, auth routes, admin API routes, favicon, and browser metadata
if (request.url.path == "/" or
request.url.path.startswith("/dashboard") or
request.url.path.startswith("/auth/") or
request.url.path.startswith("/api/admin") or
request.url.path == "/favicon.ico" or
request.url.path.startswith("/.well-known/")):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment