From c8bb398dae124714eb1f219b367220bb324d6be9 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Wed, 6 Nov 2024 10:46:14 +0530 Subject: [PATCH] fix: tp json --- supertokens_python/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supertokens_python/types.py b/supertokens_python/types.py index c731f01b..2cf34204 100644 --- a/supertokens_python/types.py +++ b/supertokens_python/types.py @@ -219,13 +219,15 @@ def to_json(self) -> Dict[str, Any]: @staticmethod def from_json(json: Dict[str, Any]) -> "User": + from supertokens_python.recipe.thirdparty.types import ThirdPartyInfo as TPI + return User( user_id=json["id"], is_primary_user=json["isPrimaryUser"], tenant_ids=json["tenantIds"], emails=json["emails"], phone_numbers=json["phoneNumbers"], - third_party=[ThirdPartyInfo.from_json(tp) for tp in json["thirdParty"]], + third_party=[TPI.from_json(tp) for tp in json["thirdParty"]], login_methods=[LoginMethod.from_json(lm) for lm in json["loginMethods"]], time_joined=json["timeJoined"], )