Skip to content

Commit 9a08db0

Browse files
committed
fix: use setAuth for realtime in signup flows also
1 parent 4d7e616 commit 9a08db0

File tree

6 files changed

+199
-127
lines changed

6 files changed

+199
-127
lines changed

package-lock.json

Lines changed: 57 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SupabaseClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ export default class SupabaseClient<
371371
this.changedAccessToken !== token
372372
) {
373373
this.changedAccessToken = token
374+
this.realtime.setAuth()
374375
} else if (event === 'SIGNED_OUT') {
375376
this.realtime.setAuth()
376377
if (source == 'STORAGE') this.auth.signOut()

test/deno/integration.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ Deno.test(
156156
await supabase.auth.signUp({ email, password })
157157
const config = { broadcast: { self: true }, private: true }
158158
channel = supabase.channel(channelName, { config })
159-
await supabase.realtime.setAuth()
160159

161160
const testMessage = { message: 'test' }
162161
let receivedMessage: any

test/integration.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ describe('Supabase Integration Tests', () => {
278278

279279
const config = { broadcast: { self: true }, private: true }
280280
channel = supabase.channel(channelName, { config })
281-
282-
await supabase.realtime.setAuth()
283281
})
284282

285283
afterEach(async () => {

test/integration/bun/integration.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ test('should subscribe to realtime channel', async () => {
1414
const email = `bun-test-${Date.now()}@example.com`
1515
const password = 'password123'
1616
await supabase.auth.signUp({ email, password })
17-
await supabase.realtime.setAuth()
1817

1918
const channelName = `bun-channel-${crypto.randomUUID()}`
2019
const config = { broadcast: { self: true }, private: true }

0 commit comments

Comments
 (0)