File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/core/supabase-js/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export default class SupabaseClient<
151151 } )
152152 }
153153
154- this . fetch = fetchWithAuth ( supabaseKey , this . _getAccessToken . bind ( this ) , settings . global . fetch )
154+ this . fetch = this . _createFetchWithAuth ( settings . global . fetch )
155155 this . realtime = this . _initRealtimeClient ( {
156156 headers : this . headers ,
157157 accessToken : this . _getAccessToken . bind ( this ) ,
@@ -206,6 +206,10 @@ export default class SupabaseClient<
206206 relation : string ,
207207 options ?: PostgrestQueryBuilderOptions
208208 ) : PostgrestQueryBuilder < ClientOptions , Schema , any > {
209+ if ( options ?. fetch ) {
210+ options . fetch = this . _createFetchWithAuth ( options . fetch )
211+ }
212+
209213 return this . rest . from ( relation , options )
210214 }
211215
@@ -408,4 +412,8 @@ export default class SupabaseClient<
408412 this . changedAccessToken = undefined
409413 }
410414 }
415+
416+ private _createFetchWithAuth ( _fetch ?: typeof global . fetch ) {
417+ return fetchWithAuth ( this . supabaseKey , this . _getAccessToken . bind ( this ) , _fetch )
418+ }
411419}
You can’t perform that action at this time.
0 commit comments