Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 633c4ab

Browse files
authored
Merge pull request #261 from hgseo16/main
fix: parse_auth_response to handle cases when data is an empty dictio…
2 parents 736f334 + f533b92 commit 633c4ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gotrue/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def parse_auth_response(data: Any) -> AuthResponse:
2828
and data["expires_in"]
2929
):
3030
session = Session.parse_obj(data)
31-
user = User.parse_obj(data["user"]) if "user" in data else User.parse_obj(data)
31+
user_data = data.get("user", data)
32+
user = User.parse_obj(user_data) if user_data else None
3233
return AuthResponse(session=session, user=user)
3334

3435

0 commit comments

Comments
 (0)