You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have valid session in supabase.auth, however if I subscribe to a channel, I'm not getting any data, because of RLS.
If I use supabase.realtime.setAuth with the access token, that has already been in the auth.session, the data starts coming.
To Reproduce
create table public.test with column uid (so the RLS can be set so users can only read their data)
allow realtime
set auth policy so that users can only read their data
sign in user in your codebase, so that you have valid supabase.auth.getSession
this code won't reliably receive updates for the signed in user in the public.test table. However if we add something like this, the data starts coming.
I was expecting that the session is propagated automatically. I only found this reference in documentation, but that's referring to custom tokens, but this happened for regular supabase sign in without no custom tokens. So either the auth should be propagated to realtime automatically or add mention do documentation to always use setAuth for realtime.
System information
OS: macOS
Browser: electron
Version of supabase-js: [2.45.2]
Version of Node.js: [16]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
I have valid session in
supabase.auth
, however if I subscribe to a channel, I'm not getting any data, because of RLS.If I use
supabase.realtime.setAuth
with the access token, that has already been in theauth.session
, the data starts coming.To Reproduce
public.test
with column uid (so the RLS can be set so users can only read their data)supabase.auth.getSession
this code won't reliably receive updates for the signed in user in the
public.test
table. However if we add something like this, the data starts coming.Expected behavior
I was expecting that the session is propagated automatically. I only found this reference in documentation, but that's referring to custom tokens, but this happened for regular supabase sign in without no custom tokens. So either the auth should be propagated to realtime automatically or add mention do documentation to always use
setAuth
for realtime.System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: