Supabase Python Understanding Struggles - how to do OAuth for multiple users and which token to stor
Initially I got supabase auth working fine with my python project for both email + password as well as Google OAuth.
Then I realized I use a single supabase client for all users, which meant that all users shared the same user profile lol.
I'm handling all the supabase auth stuff in my python backend fyi, i.e. redirection, exchange code for session etc.
Now I'm trying to figure out:
A) Which token do I need to store as a cookie to persist sessions? I.e. when a user logs in from the same browser but with a different tab, the user should be logged in automatically
B) How to pass the token from the cookie to the supabase client to retrieve the correct session?
C) Google OAuth: when using the global supabase instance, I can login with google. In my tests however I always fetched a new supabase instance on each page load. Afterwards I get redirected from google with the
My main source of knowledge are the docs: https://supabase.com/docs/reference/python/auth-setsession , happy about any other resources.
Then I realized I use a single supabase client for all users, which meant that all users shared the same user profile lol.
I'm handling all the supabase auth stuff in my python backend fyi, i.e. redirection, exchange code for session etc.
Now I'm trying to figure out:
A) Which token do I need to store as a cookie to persist sessions? I.e. when a user logs in from the same browser but with a different tab, the user should be logged in automatically
B) How to pass the token from the cookie to the supabase client to retrieve the correct session?
C) Google OAuth: when using the global supabase instance, I can login with google. In my tests however I always fetched a new supabase instance on each page load. Afterwards I get redirected from google with the
code= in the header. But now I get the classic oth auth code and code verifier should be non-empty error. This makes me think: can't I use separate supabase clients for OAuth?My main source of knowledge are the docs: https://supabase.com/docs/reference/python/auth-setsession , happy about any other resources.
