Auth woes - please help!

Hi everyone!

Very novice developer here, making the jump from completely no-code tools to WeWeb + Supabase to build my first “real” side project. Please keep in mind I might be lacking some very basic notions that are obvious to more experienced folks.

I’ve been taking the first level WeWeb Academy course and it’s been great so far, except for one thing. The issue I’m having has to do with auth, and specifically accessing Supabase data in WeWeb in order to bind database properties to WeWeb elements.

The video that covers how to do this (Get and Display Supabase Data in WeWeb) talks about row-level security, and I guess for the purposes of the exercise says to set up an “everyone can access” policy in Supabase to be able to pull the data in WeWeb. Obviously that’s not a viable approach for a production project, or even for development purposes.

Next I followed the instructions in this WeWeb documentation article (down to the profiles vs roles section). As far as I’m aware, I did everything as instructed.

Next, following advice I received in response to a comment I posted on the above video, I tried signing up with my own email address with the intent of giving myself an admin role in order to be able to access the Supabase data I need to continue development in WeWeb. I received the signup confirmation email, but clicking the confirmation link led me to an error page.

Now I can see that the corresponding user has been created in the Supabase auth schema users table, but it doesn’t show up in WeWeb

And if I try creating the user in WeWeb directly it throws an error saying the email address is already in use.

Trying to log into my WeWeb app with the user account also fails with a variety of errors:

Error 1
name: "TypeError"
stack: "TypeError: Cannot read properties of null (reading 'map') at Object.getUserRoles (https://cdn.weweb.io/components/1fa0dd68-5069-436c-9a7d-3b54c340f1fa/8f2eff85-1c3f-4c12-bc94-0f338c0ccbfa/dist/manager.js:1:106786) at async Object.refreshAuthUser (https://cdn.weweb.io/components/1fa0dd68-5069-436c-9a7d-3b54c340f1fa/8f2eff85-1c3f-4c12-bc94-0f338c0ccbfa/dist/manager.js:1:106229) at async Object.signInEmail (https://cdn.weweb.io/components/1fa0dd68-5069-436c-9a7d-3b54c340f1fa/8f2eff85-1c3f-4c12-bc94-0f338c0ccbfa/dist/manager.js:1:103738) at async eval (eval at executeCode (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1:309705), :1:28) at async executeCode (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1:309699) at async xt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:34919) at async Pt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:23982) at async Dt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:22768)"
message: "Cannot read properties of null (reading 'map')"
Error 2
name: "TypeError"
stack: "TypeError: Cannot read properties of null (reading 'map') at Object.getUserRoles (https://cdn.weweb.io/components/1fa0dd68-5069-436c-9a7d-3b54c340f1fa/8f2eff85-1c3f-4c12-bc94-0f338c0ccbfa/dist/manager.js:1:106786) at async Object.refreshAuthUser (https://cdn.weweb.io/components/1fa0dd68-5069-436c-9a7d-3b54c340f1fa/8f2eff85-1c3f-4c12-bc94-0f338c0ccbfa/dist/manager.js:1:106229) at async Object.signInEmail (https://cdn.weweb.io/components/1fa0dd68-5069-436c-9a7d-3b54c340f1fa/8f2eff85-1c3f-4c12-bc94-0f338c0ccbfa/dist/manager.js:1:103738) at async eval (eval at executeCode (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1:309705), :1:28) at async executeCode (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1:309699) at async xt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:34919) at async Pt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:23982) at async Dt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:22768)"
message: "Cannot read properties of null (reading 'map')"```
Error 3
name: "Error"

stack: "Error: Variable not found. at xt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:25757) at Pt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:23988) at Dt (https://editor-cdn.weweb.io/public/js/index.8ad6d39a.js:1270:23209)"

message: "Variable not found."

So yeah, I don’t really know what do to with this and would appreciate any help anyone can offer!

Thank you,

GD

So you have RLS set up? I’d need to see more of your setup to be able to debug. That error with a variable sounds like something Supabase might return.

Hey, thank you for the reply!

I do and I tried a few different policies with no success. Currently I just have one policy on the particular table I’m trying to access in WeWeb, that grants full access to authenticated users.

I think I have a few different problems that are compounding each other. My first reaction would be to try to either force-confirm the previously created but unsuccessfully confirmed user or delete it to try again, but I can’t figure out how to do that either from WeWeb or in Supabase. At the same time, I suspect even if I succeed in doing that that my next attempt at signup will just do the same thing again (confirmation link sending to an error page) and I’d like to get that fixed.

And under all this I’m still not 100% sure getting all this resolved would solve my initial problem, which is to access data from Superbase in WeWeb so I can continue my build. Can you confirm that, if I log into a user account with the correct permissions in my app from the WeWeb editor, i.e. that the following menu will return data from the selected source instead of “No data fetched (Empty array)”?

Thanks, and please let me know what further information I should provide that would help you help me!

Hello, yes, you not seeing the data (receiving an empty array []) is the way of Supabase telling you that RLS works.

If I were you, I’d try to re-do the whole auth setup, or atleast review it based upon the materials/tutorials you mentioned above.