sync update from LAN repo (source dhk-1 @ 3b1ec5b4)
This commit is contained in:
1 parent
da6521b6cb
commit
264e2200d6
995 files changed
+148105
-13399
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
|
||||
|
||||
Reference in new issue
Block a user