@@ -99,14 +99,15 @@ export default class SupabaseClient<
99
99
const defaultStorageKey = `sb-${ new URL ( this . authUrl ) . hostname . split ( '.' ) [ 0 ] } -auth-token`
100
100
this . storageKey = options ?. auth ?. storageKey ?? defaultStorageKey
101
101
102
- const settings = { ...DEFAULT_OPTIONS ?. global , ...options }
103
- const authSettings = Object . assign ( DEFAULT_OPTIONS . global , DEFAULT_OPTIONS . auth , settings . auth )
104
- const dbSettings = Object . assign ( DEFAULT_OPTIONS . global , DEFAULT_OPTIONS . db , settings . db )
102
+ const settings = Object . assign ( DEFAULT_OPTIONS , options )
105
103
106
- this . headers = settings . headers
104
+ const authSettings = settings . auth
105
+ const dbSettings = settings . db
107
106
108
- this . auth = this . _initSupabaseAuthClient ( authSettings , this . headers , this . fetch )
109
- this . fetch = fetchWithAuth ( supabaseKey , this . _getAccessToken . bind ( this ) , this . fetch )
107
+ this . headers = settings . global . headers
108
+
109
+ this . auth = this . _initSupabaseAuthClient ( authSettings , this . headers , settings . global . fetch )
110
+ this . fetch = fetchWithAuth ( supabaseKey , this . _getAccessToken . bind ( this ) , settings . global . fetch )
110
111
111
112
this . realtime = this . _initRealtimeClient ( { headers : this . headers , ...settings . realtime } )
112
113
this . rest = new PostgrestClient ( `${ _supabaseUrl } /rest/v1` , {
0 commit comments