fix: /auth/users/me now supports NPM forward auth headers
Added get_current_user_or_forward_auth() combined dependency that: - First checks for X-authentik-* headers from NPM forward auth (web) - Falls back to JWT Bearer token validation (mobile/native) This fixes web authentication where browsers don't send Bearer tokens but rely on NPM's forward auth proxy to pass user info via headers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
e2226cd923
commit
dd0997679f
@@ -20,7 +20,7 @@ from src.domains.auth.schemas import (
|
||||
ApiKeysListResponse,
|
||||
)
|
||||
from src.domains.auth.service import AuthService
|
||||
from src.domains.auth.oidc import get_current_user
|
||||
from src.domains.auth.oidc import get_current_user, get_current_user_or_forward_auth
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
@@ -326,7 +326,7 @@ class AuthController(BaseController):
|
||||
},
|
||||
)
|
||||
async def get_current_user_profile(
|
||||
user_claims: dict = Depends(get_current_user),
|
||||
user_claims: dict = Depends(get_current_user_or_forward_auth),
|
||||
session: AsyncSession = Depends(get_async_session),
|
||||
) -> UserProfileResponse:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user