Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@supabase/functions-js": "2.4.3",
"@supabase/node-fetch": "2.6.15",
"@supabase/postgrest-js": "1.16.3",
"@supabase/realtime-js": "2.10.9",
"@supabase/realtime-js": "2.11.0",
"@supabase/storage-js": "2.7.1"
},
"devDependencies": {
Expand Down
9 changes: 5 additions & 4 deletions src/SupabaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ export default class SupabaseClient<

this.fetch = fetchWithAuth(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch)

this.realtime = this._initRealtimeClient({ headers: this.headers, ...settings.realtime })
this.realtime = this._initRealtimeClient({
headers: this.headers,
accessToken: this.accessToken,
...settings.realtime,
})
this.rest = new PostgrestClient(`${_supabaseUrl}/rest/v1`, {
headers: this.headers,
schema: settings.db.schema,
Expand Down Expand Up @@ -330,9 +334,6 @@ export default class SupabaseClient<
(event === 'TOKEN_REFRESHED' || event === 'SIGNED_IN') &&
this.changedAccessToken !== token
) {
// Token has changed
this.realtime.setAuth(token ?? null)

this.changedAccessToken = token
} else if (event === 'SIGNED_OUT') {
// Token is removed
Expand Down
Loading