File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export default class SupabaseClient<
145145 } )
146146 }
147147
148- this . fetch = fetchWithAuth ( supabaseKey , this . _getAccessToken . bind ( this ) , settings . global . fetch )
148+ this . fetch = this . _createFetchWithAuth ( settings . global . fetch )
149149 this . realtime = this . _initRealtimeClient ( {
150150 headers : this . headers ,
151151 accessToken : this . _getAccessToken . bind ( this ) ,
@@ -200,6 +200,10 @@ export default class SupabaseClient<
200200 relation : string ,
201201 options ?: PostgrestQueryBuilderOptions
202202 ) : PostgrestQueryBuilder < ClientOptions , Schema , any > {
203+ if ( options ?. fetch ) {
204+ options . fetch = this . _createFetchWithAuth ( options . fetch )
205+ }
206+
203207 return this . rest . from ( relation , options )
204208 }
205209
@@ -386,4 +390,8 @@ export default class SupabaseClient<
386390 this . changedAccessToken = undefined
387391 }
388392 }
393+
394+ private _createFetchWithAuth ( _fetch ?: typeof global . fetch ) {
395+ return fetchWithAuth ( this . supabaseKey , this . _getAccessToken . bind ( this ) , _fetch )
396+ }
389397}
You can’t perform that action at this time.
0 commit comments