Open asaki-daisuke opened 3 months ago
I experienced the same issue with flutter realtime, realtime works after disabling the RLS on the table. However the solution is not really good since it was used for the authenticated users checking. I wonder if it was due to the access token from JWT not properly initialized to the realtime client instance?
I tried
final client = Supabase.instance.client;
client.realtime.setAuth(access_token);
In flutter to set the access JWT token for the client instance during initialization of Supabase, and it still did not work.
Describe the bug This issue is related to this. When RLS is disabled on the table, the real-time connection works successfully. However, I would like to enable RLS and verify the custom JWT passed from the Flutter app. It is working fine with
SendChat
,ReadRoomChats
methods. But it's not working with realtime connection.Looks like it is similar to this issue. We have the following method in TypeScript client to achieve this.
client.realtime.setAuth(accessToken);
Current Code
To Reproduce Use the above code and insert a new record into the Supabase table.
Version (please complete the following information): On macOS ├── supabase_flutter 2.5.6 │ ├── supabase 2.2.2 │ │ ├── functions_client 2.2.0 │ │ ├── gotrue 2.8.1 │ │ ├── postgrest 2.1.2 │ │ ├── realtime_client 2.1.0 │ │ ├── storage_client 2.0.2
Additional context