Skip to content

Commit

Permalink
return None when no session or jwt on get_user calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jantznick committed Sep 10, 2023
1 parent ff35a92 commit 50fa8b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gotrue/_async/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ async def get_user(self, jwt: Union[str, None] = None) -> UserResponse:
session = await self.get_session()
if session:
jwt = session.access_token
else:
return None
return await self._request("GET", "user", jwt=jwt, xform=parse_user_response)

async def update_user(self, attributes: UserAttributes) -> UserResponse:
Expand Down
2 changes: 2 additions & 0 deletions gotrue/_sync/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def get_user(self, jwt: Union[str, None] = None) -> UserResponse:
session = self.get_session()
if session:
jwt = session.access_token
else:
return None
return self._request("GET", "user", jwt=jwt, xform=parse_user_response)

def update_user(self, attributes: UserAttributes) -> UserResponse:
Expand Down

0 comments on commit 50fa8b0

Please sign in to comment.