Skip to content

Commit

Permalink
Merge pull request #1328 from supabase/chore/upgrade-rc-for-release
Browse files Browse the repository at this point in the history
chore: upgrade rc for release
  • Loading branch information
soedirgo authored Dec 11, 2024
2 parents 78f8d6d + e74067c commit d76c7b3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
"serve:coverage": "npm run test:coverage && serve test/coverage"
},
"dependencies": {
"@supabase/auth-js": "2.65.1",
"@supabase/auth-js": "2.66.1",
"@supabase/functions-js": "2.4.3",
"@supabase/node-fetch": "2.6.15",
"@supabase/postgrest-js": "1.17.5",
"@supabase/realtime-js": "2.10.7",
"@supabase/postgrest-js": "1.17.7",
"@supabase/realtime-js": "2.11.2",
"@supabase/storage-js": "2.7.1"
},
"devDependencies": {
Expand Down
13 changes: 6 additions & 7 deletions src/SupabaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,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._getAccessToken.bind(this),
...settings.realtime,
})
this.rest = new PostgrestClient(`${_supabaseUrl}/rest/v1`, {
headers: this.headers,
schema: settings.db.schema,
Expand Down Expand Up @@ -332,13 +335,9 @@ 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
this.realtime.setAuth(this.supabaseKey)
this.realtime.setAuth()
if (source == 'STORAGE') this.auth.signOut()
this.changedAccessToken = undefined
}
Expand Down

0 comments on commit d76c7b3

Please sign in to comment.