Skip to content

bug: missing enum value verification_email_link for email verification in body.email_addresses.0.verification #175

@JMaio

Description

@JMaio

hi, we're using Clerk for user auth on a web application and have noticed that users with email+password login have been having issues logging in recently.

it looks as though the Clerk API is returning verification_email_link as an email address verification field, however this is not mapped in the python SDK backend model here: (nor is it present in the Backend API schema https://clerk.com/docs/reference/backend-api/tag/users/get/users/%7Buser_id%7D)

Verification = Annotated[
Union[
Annotated[Otp, Tag("verification_otp")],
Annotated[Admin, Tag("verification_admin")],
Annotated[FromOAuth, Tag("verification_from_oauth")],
Annotated[Ticket, Tag("verification_ticket")],
],
Discriminator(lambda m: get_discriminator(m, "object", "object")),
]

here's a sample of our logs:

  File "/opt/render/project/src/backend/services/clerk_service.py", line 58, in clerk_get_user
    clerk_user = clerk_sdk.users.get(user_id=user_id)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/render/project/src/.venv/lib/python3.12/site-packages/clerk_backend_api/users.py", line 949, in get
    return utils.unmarshal_json(http_res.text, Optional[models.User])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/render/project/src/.venv/lib/python3.12/site-packages/clerk_backend_api/utils/serializers.py", line 140, in unmarshal_json
    return unmarshal(from_json(raw), typ)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/render/project/src/.venv/lib/python3.12/site-packages/clerk_backend_api/utils/serializers.py", line 150, in unmarshal
    m = unmarshaller(body=val)
        ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/render/project/src/.venv/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for Unmarshaller
body.email_addresses.0.verification
  Input tag 'verification_email_link' found using <lambda>() does not match any of the expected tags: 'verification_otp', 'verification_admin', 'verification_from_oauth', 'verification_ticket' [type=union_tag_invalid, input_value={'object': 'verification_...0TpYxjQKkD74Ht01tajxi1'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/union_tag_invalid

please let us know if this could be added or if we can provide any more info to help debug this issue 😄

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