{"record":{"id":"3b0e5fa07ca55240","repo":"langchain-ai/langgraph","slug":"auth-handler-getattr-fn-name-fn-must-3b0e5f","errorCode":null,"errorMessage":"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'ctx: AuthContext' parameter. Update the function signature to include this required parameter.","messagePattern":"Auth handler '(.+?)' must have a 'ctx: AuthContext' parameter\\. Update the function signature to include this required parameter\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/auth/__init__.py","lineNumber":855,"sourceCode":"\ndef _validate_handler(fn: Callable[..., typing.Any]) -> None:\n    \"\"\"Validates that an auth handler function meets the required signature.\n\n    Auth handlers must:\n    1. Be async functions\n    2. Accept a ctx parameter of type AuthContext\n    3. Accept a value parameter for the data being authorized\n    \"\"\"\n    if not inspect.iscoroutinefunction(fn):\n        raise ValueError(\n            f\"Auth handler '{getattr(fn, '__name__', fn)}' must be an async function. \"\n            \"Add 'async' before 'def' to make it asynchronous and ensure\"\n            \" any IO operations are non-blocking.\"\n        )\n\n    sig = inspect.signature(fn)\n    if \"ctx\" not in sig.parameters:\n        raise ValueError(\n            f\"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'ctx: AuthContext' parameter. \"\n            \"Update the function signature to include this required parameter.\"\n        )\n    if \"value\" not in sig.parameters:\n        raise ValueError(\n            f\"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'value' parameter. \"\n            \" The value contains the mutable data being sent to the endpoint.\"\n            \"Update the function signature to include this required parameter.\"\n        )\n\n\ndef is_studio_user(\n    user: types.MinimalUser | types.BaseUser | types.MinimalUserDict,\n) -> bool:\n    return isinstance(user, types.StudioUser) or (\n        isinstance(user, dict) and user.get(\"kind\") == \"StudioUser\"\n    )\n","sourceCodeStart":837,"sourceCodeEnd":873,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/auth/__init__.py#L837-L873","documentation":"Error \"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'ctx: AuthContext' parameter. Update the function signature to include this required parameter.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/auth/__init__.py:855 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}