1
- from typing import Dict , Optional
1
+ from typing import Dict , Union
2
2
3
- from gotrue import (
4
- CookieOptions ,
5
- SyncGoTrueAPI ,
6
- SyncGoTrueClient ,
7
- SyncMemoryStorage ,
8
- SyncSupportedStorage ,
9
- )
10
- from gotrue .constants import COOKIE_OPTIONS
3
+ from gotrue import SyncGoTrueClient , SyncMemoryStorage , SyncSupportedStorage
4
+
5
+ # TODO - export this from GoTrue-py in next release
6
+ from httpx import Client as BaseClient
7
+
8
+
9
+ class SyncClient (BaseClient ):
10
+ def aclose (self ) -> None :
11
+ self .close ()
11
12
12
13
13
14
class SupabaseAuthClient (SyncGoTrueClient ):
@@ -18,22 +19,20 @@ def __init__(
18
19
* ,
19
20
url : str ,
20
21
headers : Dict [str , str ] = {},
22
+ storage_key : Union [str , None ] = None ,
21
23
auto_refresh_token : bool = True ,
22
24
persist_session : bool = True ,
23
- local_storage : SyncSupportedStorage = SyncMemoryStorage (),
24
- cookie_options : CookieOptions = CookieOptions .parse_obj (COOKIE_OPTIONS ),
25
- api : Optional [SyncGoTrueAPI ] = None ,
26
- replace_default_headers : bool = False ,
25
+ storage : SyncSupportedStorage = SyncMemoryStorage (),
26
+ http_client : Union [SyncClient , None ] = None ,
27
27
):
28
28
"""Instantiate SupabaseAuthClient instance."""
29
29
SyncGoTrueClient .__init__ (
30
30
self ,
31
31
url = url ,
32
32
headers = headers ,
33
+ storage_key = storage_key ,
33
34
auto_refresh_token = auto_refresh_token ,
34
35
persist_session = persist_session ,
35
- local_storage = local_storage ,
36
- cookie_options = cookie_options ,
37
- api = api ,
38
- replace_default_headers = replace_default_headers ,
36
+ storage = storage ,
37
+ http_client = http_client ,
39
38
)
0 commit comments