Skip to content

_handle_token_response should accept 201 responses #1502

@jnjpng

Description

@jnjpng

if response.status_code != 200:

MCP servers such as https://supabase.com/docs/guides/getting-started/mcp will return 201 on successful token exchange. The current logic breaks the flow even after the exchange has been successful on the resource side - something as simple as the following fixes throwing an unnecessary error here.

...
if response.status_code != 200 and response.status_code != 201:
    raise OAuthTokenError(f"Token exchange failed: {response.status_code}")
....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions