Skip to content

Commit 5f7f3d5

Browse files
authored
Merge pull request #305 from supabase/fix/auth-init
fix: missing fetch during auth init
2 parents b588864 + cb06fc6 commit 5f7f3d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SupabaseClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ export default class SupabaseClient {
6262
this.authUrl = `${supabaseUrl}/auth/v1`
6363
this.storageUrl = `${supabaseUrl}/storage/v1`
6464
this.schema = settings.schema
65+
this.fetch = settings.fetch
6566

6667
this.auth = this._initSupabaseAuthClient(settings)
6768
this.realtime = this._initRealtimeClient(settings.realtime)
6869

69-
this.fetch = settings.fetch
70-
7170
// In the future we might allow the user to pass in a logger to receive these events.
7271
// this.realtime.onOpen(() => console.log('OPEN'))
7372
// this.realtime.onClose(() => console.log('CLOSED'))
@@ -159,6 +158,7 @@ export default class SupabaseClient {
159158
detectSessionInUrl,
160159
localStorage,
161160
headers,
161+
fetch,
162162
}: SupabaseClientOptions) {
163163
const authHeaders = {
164164
Authorization: `Bearer ${this.supabaseKey}`,
@@ -171,7 +171,7 @@ export default class SupabaseClient {
171171
persistSession,
172172
detectSessionInUrl,
173173
localStorage,
174-
fetch: this.fetch,
174+
fetch,
175175
})
176176
}
177177

0 commit comments

Comments
 (0)