Hi everyone, I’m working with Supabase and recently added role management by creating two new tables:
roles (id UUID, name)
userRoles (id UUID→ roles.id, userId → auth.users.id, roleId → roles.id)
I linked these tables properly in Supabase. Before adding them, user login in WeWeb was working perfectly. But after adding these tables—even with RLS policies disabled—the login stops working, and authenticated users don’t show up in WeWeb.
Could adding these tables somehow interfere with the authentication flow? Is it possible that missing roles for existing users or some hidden Supabase dependency is causing this? How can I implement role management without breaking the login/auth user loading in WeWeb?
Any advice or similar experiences would be really appreciated. Thanks!
Thanks for sharing the video! I had read the documentation before, but I hadn’t seen the video, super helpful.
I followed the steps in the video: I enabled RLS and created the policies on both tables just like in the tutorial.
Here’s the schema again for reference:
roles (id UUID, name)
userRoles (id UUID, userId → auth.users.id, roleId → roles.id)
I’m still running into two main issues:
For users who registered before I implemented roles, even if I manually assign a role to them, WeWeb doesn’t seem to recognize them as authenticated anymore. Logging in doesn’t help, it’s as if they no longer exist in the auth.users view from WeWeb’s perspective.
When I use the “Manage User” panel, the Users section still shows no authenticated users, even though login appears to work with newly created users. For those new users, login works fine, and the role is correctly detected in variables, but does not show in the Auth/Users panel.
Yes, I’ve already manually assigned the roles directly from Supabase.
Here’s what I’m observing:
For new users (those created after I added the two tables), everything works as expected: the role variable is populated in WeWeb, and authenticated = true. However, they still don’t appear in the Auth → Users panel in WeWeb.
For old users (created before the new tables), even if I assign them a role manually in Supabase, the variables in WeWeb are not populated at all. It’s like WeWeb doesn’t recognize them as authenticated anymore.
So the role assignment works only partially—variables are working for new users but not showing in the user panel, and old users seem completely disconnected.
This sounds like the WeWeb plugin can’t find the roles, if this is not RLS, then maybe an improper mapping? Have you updated the setting in the Supabase plugin to point to your tables?
Yes, and as you can see in the photo, with the “new” user it works — the role shows up in the variable — but not in the panel. For the “old” it goes on error but only from weweb not in supabase.