mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 22:14:18 +02:00
Fix middleware example: add context parameter to call_next() (#2215)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
This commit is contained in:
parent
65260c91d5
commit
577ed6e9a3
1 changed files with 2 additions and 2 deletions
|
|
@ -210,8 +210,8 @@ class UserAuthMiddleware(Middleware):
|
|||
# Middleware stores user info in context state
|
||||
context.fastmcp_context.set_state("user_id", "user_123")
|
||||
context.fastmcp_context.set_state("permissions", ["read", "write"])
|
||||
|
||||
return await call_next()
|
||||
|
||||
return await call_next(context)
|
||||
|
||||
@mcp.tool
|
||||
async def secure_operation(data: str, ctx: Context) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue