Skip to content

Commit a0ee8b6

Browse files
committed
push token instead of using binded expression
1 parent 23825c6 commit a0ee8b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SupabaseClient.ts

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

test/unit/SupabaseClient.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,13 @@ describe('SupabaseClient', () => {
277277

278278
// @ts-ignore - accessing private method for testing
279279
client._handleTokenChanged('TOKEN_REFRESHED', 'CLIENT', 'new-token')
280-
expect(setAuthSpy).toHaveBeenCalledWith()
280+
expect(setAuthSpy).toHaveBeenCalledWith('new-token')
281281

282282
setAuthSpy.mockClear()
283283

284284
// @ts-ignore - accessing private method for testing
285285
client._handleTokenChanged('SIGNED_IN', 'CLIENT', 'signin-token')
286-
expect(setAuthSpy).toHaveBeenCalledWith()
286+
expect(setAuthSpy).toHaveBeenCalledWith('signin-token')
287287

288288
setAuthSpy.mockClear()
289289

0 commit comments

Comments
 (0)