fix(mcp): current_user not being set in MCP requests (#25393)

This commit is contained in:
Novice 2025-09-09 14:58:14 +08:00 committed by GitHub
parent c595c03452
commit e180c19cca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -86,9 +86,7 @@ def load_user_from_request(request_from_flask_login):
if not app_mcp_server:
raise NotFound("App MCP server not found.")
end_user = (
db.session.query(EndUser)
.where(EndUser.external_user_id == app_mcp_server.id, EndUser.type == "mcp")
.first()
db.session.query(EndUser).where(EndUser.session_id == app_mcp_server.id, EndUser.type == "mcp").first()
)
if not end_user:
raise NotFound("End user not found.")