Skip to content

Commit

Permalink
fix: tp json
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Nov 6, 2024
1 parent 0ac99aa commit c8bb398
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion supertokens_python/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
Expand Down

0 comments on commit c8bb398

Please sign in to comment.