Skip to content

Commit 998bb68

Browse files
authored
fix: prevent async calls in _listenForAuthEvents (#1412)
1 parent 642ff7f commit 998bb68

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/SupabaseClient.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,11 @@ export default class SupabaseClient<
322322
}
323323

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

supabase/.temp/cli-latest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.22.4
1+
v2.22.12

0 commit comments

Comments
 (0)