Is it possible to give users an api key they can a...
# off-topic
r
Is it possible to give users an api key they can access their account with (and still apply RLS) instead of needing to go through an auth flow first?
I'm currently doing this but it seems like there should be a better way.
Copy code
const { session, error } = await supabase.auth.api.signInWithEmail(username, password)

supabase.auth.setAuth(session.access_token)

const { data, error } = await supabase.from('Tablename').insert([...])
I'd rather has the user send in their API key that I generated for them (or Supabase generated for them) and pass that along to Supabase.
It looks like this is already a feature request: https://github.com/supabase/supabase/issues/3233
I guess I'll figure something out
s
You can use anything for your RLS, if you want to generate a token and store it in a table and then use that with RLS you can do so
It just mean you have to manage that yourself and if I was to find out another user's token that you generated then I can get access to their data
r
That's what I was thinking.