sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)

This commit is contained in:
gozeros committed 2026-10-21 14:51:31 +08:00
1 parent 4f7f07504a
commit 8bc8b0e082
1651 files changed
+278599 -11416

No files matched your search

@@ -17,6 +17,7 @@ from langgraph_sdk import Auth
from app.gateway.auth.disabled_mode import get_assumed_user_for_disabled_auth, is_auth_disabled
from app.gateway.auth.errors import TokenError
from app.gateway.auth.jwt import decode_token
from app.gateway.auth.session_policy import session_policy_error
from app.gateway.auth.token_source import get_explicit_or_session_token
from app.gateway.deps import get_local_provider
@@ -97,6 +98,9 @@ async def authenticate(request):
detail="Invalid token",
)
if policy_error := session_policy_error(payload):
raise Auth.exceptions.HTTPException(status_code=401, detail=policy_error)
user = await get_local_provider().get_user(payload.sub)
if user is None:
raise Auth.exceptions.HTTPException(
@@ -106,7 +110,7 @@ async def authenticate(request):
if user.token_version != payload.ver:
raise Auth.exceptions.HTTPException(
status_code=401,
detail="Token revoked (password changed)",
detail="登录已失效:密码已更改或账号已在其他位置登录,请重新登录",
)
return payload.sub