Skip to content

Commit 0a080d0

Browse files
author
Andrew Smith
authoredSep 29, 2023
Merge pull request #573 from supabase-community/silentworks/narrow-auth-events-listening
feat: narrow the auth event listening
2 parents d1f4574 + 5e5b1e4 commit 0a080d0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎.github/workflows/ci.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: CI/CD
22

3-
on: [pull_request, push, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
49

510
jobs:
611
test:

‎supabase/client.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,10 @@ def _get_token_header(self):
232232
}
233233

234234
def _listen_to_auth_events(self, event: AuthChangeEvent, session):
235-
# reset postgrest instance on event change
236-
self._postgrest = None
237-
self._storage = None
235+
if event in ["SIGNED_IN", "TOKEN_REFRESHED", "SIGNED_OUT"]:
236+
# reset postgrest and storage instance on event change
237+
self._postgrest = None
238+
self._storage = None
238239

239240

240241
def create_client(

0 commit comments

Comments
 (0)
Please sign in to comment.