Skip to content

Commit 3efb4a6

Browse files
fix: update SupabaseAuthClient to use super instead of calling base class (#1045)
Co-authored-by: Andrew Smith <[email protected]>
1 parent d6dbeff commit 3efb4a6

File tree

3 files changed

+36
-8
lines changed

3 files changed

+36
-8
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ tests_only:
1818
build_sync:
1919
poetry run unasync supabase tests
2020
sed -i 's/asyncio.create_task(self.realtime.set_auth(access_token))//g' supabase/_sync/client.py
21+
sed -i 's/asynch/synch/g' supabase/_sync/auth_client.py
22+
sed -i 's/Async/Sync/g' supabase/_sync/auth_client.py

supabase/_async/auth_client.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class AsyncSupabaseAuthClient(AsyncGoTrueClient):
13-
"""SupabaseAuthClient"""
13+
"""Supabase Auth Client for asynchronous operations."""
1414

1515
def __init__(
1616
self,
@@ -26,12 +26,25 @@ def __init__(
2626
verify: bool = True,
2727
proxy: Optional[str] = None,
2828
):
29-
"""Instantiate SupabaseAuthClient instance."""
29+
"""
30+
Instantiate a SupabaseAuthClient instance.
31+
32+
Args:
33+
url (str): The URL of the Supabase instance.
34+
headers (Optional[Dict[str, str]]): Optional headers to include in requests.
35+
storage_key (Optional[str]): Key to store session information.
36+
auto_refresh_token (bool): Whether to automatically refresh the token. Defaults to True.
37+
persist_session (bool): Whether to persist the session. Defaults to True.
38+
storage (AsyncSupportedStorage): Storage mechanism. Defaults to AsyncMemoryStorage().
39+
http_client (Optional[AsyncClient]): HTTP client for making requests. Defaults to None.
40+
flow_type (AuthFlowType): Type of authentication flow. Defaults to "implicit".
41+
verify (bool): Whether to verify SSL certificates. Defaults to True.
42+
proxy (Optional[str]): Proxy URL. Defaults to None.
43+
"""
3044
if headers is None:
3145
headers = {}
3246

33-
AsyncGoTrueClient.__init__(
34-
self,
47+
super().__init__(
3548
url=url,
3649
headers=headers,
3750
storage_key=storage_key,

supabase/_sync/auth_client.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class SyncSupabaseAuthClient(SyncGoTrueClient):
13-
"""SupabaseAuthClient"""
13+
"""Supabase Auth Client for synchronous operations."""
1414

1515
def __init__(
1616
self,
@@ -26,12 +26,25 @@ def __init__(
2626
verify: bool = True,
2727
proxy: Optional[str] = None,
2828
):
29-
"""Instantiate SupabaseAuthClient instance."""
29+
"""
30+
Instantiate a SupabaseAuthClient instance.
31+
32+
Args:
33+
url (str): The URL of the Supabase instance.
34+
headers (Optional[Dict[str, str]]): Optional headers to include in requests.
35+
storage_key (Optional[str]): Key to store session information.
36+
auto_refresh_token (bool): Whether to automatically refresh the token. Defaults to True.
37+
persist_session (bool): Whether to persist the session. Defaults to True.
38+
storage (SyncSupportedStorage): Storage mechanism. Defaults to SyncMemoryStorage().
39+
http_client (Optional[SyncClient]): HTTP client for making requests. Defaults to None.
40+
flow_type (AuthFlowType): Type of authentication flow. Defaults to "implicit".
41+
verify (bool): Whether to verify SSL certificates. Defaults to True.
42+
proxy (Optional[str]): Proxy URL. Defaults to None.
43+
"""
3044
if headers is None:
3145
headers = {}
3246

33-
SyncGoTrueClient.__init__(
34-
self,
47+
super().__init__(
3548
url=url,
3649
headers=headers,
3750
storage_key=storage_key,

0 commit comments

Comments
 (0)