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
user = supabase.auth.sign_in_with_password({"email": email, "password": password})
session = supabase.auth.get_session() # this refreshes the access token if needed
# tried this first
supabase.postgrest.auth(
# verified that this was real
token=session.access_token
) # this sets the right "authorization" header on HTTP requests to PostgREST
res = supabase.auth.set_session(session.access_token, session.refresh_token)
select_data = supabase.table("todos").select("*").execute()
print(select_data)
insert_data = supabase.table("todos").insert({"name": "Buy milk"}).execute()
print(insert_data)
Expected behavior
As tested with RLS off, I can retrieve the contents of the rows.
I can also view do a cURL request with the access_token of the session and retrieve the rows.
So my best guess is that although the user itself is successfully authenticated, there's no way for us to successfully tell the client which executes the queries, that we have given it an authenticated user, even though I have used the workarounds mentioned by the community.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Describe the bug
Even after verifying the user is authenticated, I cannot access my data.
I've confirmed through print statements that
access_tokento the cURL request)I created two simple RLS policies for allowing
To Reproduce
Steps to reproduce the behavior:
Results:
Data is empty
RLS error for insert:
Expected behavior
As tested with RLS off, I can retrieve the contents of the rows.
I can also view do a cURL request with the access_token of the session and retrieve the rows.
So my best guess is that although the user itself is successfully authenticated, there's no way for us to successfully tell the client which executes the queries, that we have given it an authenticated user, even though I have used the workarounds mentioned by the community.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):