Skip to content

Commit

Permalink
fix: Revert "feat: pass global header bearer token as apikey to Realt…
Browse files Browse the repository at this point in the history
…imeClient (#699)"

This reverts commit b55d386.
  • Loading branch information
w3b6x9 committed Feb 5, 2023
1 parent b55d386 commit 153ed4b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/SupabaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,9 @@ export default class SupabaseClient<
}

private _initRealtimeClient(options: RealtimeClientOptions) {
const authHeader = options.headers?.Authorization
const authToken = authHeader?.startsWith('Bearer ') && authHeader.split(' ')[1]
return new RealtimeClient(this.realtimeUrl, {
...options,
params: { ...{ apikey: authToken || this.supabaseKey }, ...options?.params },
params: { ...{ apikey: this.supabaseKey }, ...options?.params },
})
}

Expand Down

0 comments on commit 153ed4b

Please sign in to comment.