Hi somebody know why the function `supabase.auth.o...
# javascript
f
Hi somebody know why the function
supabase.auth.onAuthStateChange((event, session)
is called twice with the event
SIGNED_IN
. There is some way to avoid or distingue between btoh calls ??
b
Does one of the calls have a null session? I seem to see that a lot so I just test for the session. Another thing you could do is just test to see if you already have a valid session and if so, ignore the call.
f
In both cases a have a valid session. And with any difference 😕
g
How close are they called apart (based on expires_at seems very close)? Is it possible you have two authState handlers installed (possibly called twice at setup)? Do you see two token refresh events ever? The only time I see two SIGNED_IN events, is moving between tabs and a refresh token request occurs about the same time.