1
1
from dataclasses import dataclass , field
2
2
from typing import Any , Dict , Optional , Union
3
3
4
- from gotrue import SyncMemoryStorage , SyncSupportedStorage
4
+ from gotrue import AuthFlowType , SyncMemoryStorage , SyncSupportedStorage
5
5
from httpx import Timeout
6
6
from postgrest .constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
7
7
from storage3 .constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
@@ -42,6 +42,9 @@ class ClientOptions:
42
42
storage_client_timeout : Union [int , float , Timeout ] = DEFAULT_STORAGE_CLIENT_TIMEOUT
43
43
"""Timeout passed to the SyncStorageClient instance"""
44
44
45
+ flow_type : AuthFlowType = "implicit"
46
+ """flow type to use for authentication"""
47
+
45
48
def replace (
46
49
self ,
47
50
schema : Optional [str ] = None ,
@@ -56,6 +59,7 @@ def replace(
56
59
storage_client_timeout : Union [
57
60
int , float , Timeout
58
61
] = DEFAULT_STORAGE_CLIENT_TIMEOUT ,
62
+ flow_type : Optional [AuthFlowType ] = None ,
59
63
) -> "ClientOptions" :
60
64
"""Create a new SupabaseClientOptions with changes"""
61
65
client_options = ClientOptions ()
@@ -73,4 +77,5 @@ def replace(
73
77
client_options .storage_client_timeout = (
74
78
storage_client_timeout or self .storage_client_timeout
75
79
)
80
+ client_options .flow_type = flow_type or self .flow_type
76
81
return client_options
0 commit comments