-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth issue, anon working #19
Comments
Would really appreciate this as well. I have printed out the RESTful request statement in the
|
@YancyFrySr once you have logged in and have a user's access_token, you can do
and then it will add that as the header |
Is this the official solution? I was also under the impression that we should be able to pass auth information through context, or create a session-ed client somehow. This is a bit problematic because for example the Storage pkg does not have a AddHeader method, and I'm suspecting the problem I'm facing right now is because of that. File uploads for anon work, but not for authenticated, likely because the Storage stuff doesn't add auth info |
Okay got it working. Reading through the code, there's a comment above apiKey within the client that it can be a client key as well:
So we have to create a user scoped client that uses client API key:
/EDIT: okay doing that is giving me "invalid api_key" errors when using DB actions. I ran out of time for debugging so just created 2 clients, one for upload and one for db..
|
Hi all, I may be doing something stupid here so please forgive me.
When i run a sign in, how do i then use that logged in user to perform requests against the DB?
My query is working with RLS allowing anon however when RLS is enabled to only allow authenticated users I don't get a response.
I've tried multiple ways of enabling auth only for SELECT on the table. for example:
My call to signIn does also respond with a user token.
In supabase logs it appears that no auth header is added to the requests:
Any help would be appreciated
The text was updated successfully, but these errors were encountered: