Thank you so much for your effort Rayz. But i tried it and it didn’t work. And even if it worked, inserting data on sign in is not useful.
But since it worked for you anyway in a specific scenario then i think the problem might be from my side.
Yes, there might be something wrong with the built-in extension too. Because it shouldn’t give that error when inserting data with a button. I mean, is it even useful at all if we use it in the sign in event?
I would really appreciate it If you provide any guides on setting up Supabase on Web Components. Because the last one i tried had a lot of errors and needs an update.
I just want to insert data into the Supabase DB. That’s it. Everything else is working, fetching, login, viewing, etc. I want users to be able to insert data into the database.
Wait a moment, mine was just a quick example, but the insertion in signInComplete has nothing to do with it.
So the bug is definitely on your side, I meant that the table must be set before every operation (as “stated” in the documentation).
If you’re not in production, first try setting permissive public rules and test again.
@RaYzZz Thank you so much for your efforts man. But I think the problem is in the component. Because I already tried the permissive public rules.
I am in production mode. I don’t think the problem is on my side.
I have tried @Ibrahim_Jamar blocks to insert data in the same table and it worked.
It worked when RLS is disabled but it gives me the same error when it’s enabled.
But with the built-in component it gives errors either way, whether RLS is enabled or not.
So, there must be something wrong with the built-in component.
No it doesn’t, this might happen on how the RLS are created, because the authorization header with the user access token satisfies supabase RLS’s. An using it in one of my project and I don’t pass or hardcode the key, or you can use the Edge functions to hide the key but it’s unnecessary to do it because of this.
I tried it on my database with RLS disabled without the apiKey it asked me for it. I don’t know if it could’ve worked some other way.
RLS policies are okay. I enabled insert for authenticated users.
The issue with those blocks and RLS policies was a missing space after the “Bearer” key and it has been fixed lol…
But now I’ve tested both, the built-in Supabase component and the Web Component, and the built-in component still asks for the secret key. So I think that’s a bug for sure.
Keep in mind that the component is not completely dead. It does retrieve data and it connects to the database, it authenticates my account, and it works just fine. The whole issue is in the insert block. Not sure if there are any other blocks that has the same or a similar issue, but the insert is what I’ve tested and is what doesn’t work for me.
And if you saw the second picture, I actually used the Access token from the authentication component just to insert data. I use the database component also to retrieve data.
After .SignInComplete, you execute RetrieveRows procedure, which sets the table (the .Select consumes the .SetTable), and then in Save.Click you call .Insert without setting the table again.