Skip to content

Commit

Permalink
Merge pull request #261 from hgseo16/main
Browse files Browse the repository at this point in the history
fix: parse_auth_response to handle cases when data is an empty dictio…
  • Loading branch information
J0 authored May 22, 2023
2 parents 736f334 + f533b92 commit 633c4ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gotrue/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def parse_auth_response(data: Any) -> AuthResponse:
and data["expires_in"]
):
session = Session.parse_obj(data)
user = User.parse_obj(data["user"]) if "user" in data else User.parse_obj(data)
user_data = data.get("user", data)
user = User.parse_obj(user_data) if user_data else None
return AuthResponse(session=session, user=user)


Expand Down

0 comments on commit 633c4ab

Please sign in to comment.