Skip to content

Commit 20204a1

Browse files
committed
fix: prevent async calls in _listenForAuthEvents (#1412)
1 parent 9721ae0 commit 20204a1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/SupabaseClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,11 @@ export default class SupabaseClient<
323323
}
324324

325325
private async _listenForAuthEvents() {
326-
return await this.auth.onAuthStateChange(async (event, session) => {
327-
await this._handleTokenChanged(event, 'CLIENT', session?.access_token)
326+
return await this.auth.onAuthStateChange((event, session) => {
327+
setTimeout(
328+
async () => await this._handleTokenChanged(event, 'CLIENT', session?.access_token),
329+
0
330+
)
328331
})
329332
}
330333

supabase/.temp/cli-latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.22.4
1+
v2.22.12

0 commit comments

Comments
 (0)