-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Description
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)
clerk-sdk-python/src/clerk_backend_api/models/emailaddress.py
Lines 337 to 345 in aad201d
| 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
Labels
No labels