# Supabase Auth (login error when filling the roles)

**URL:** https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438
**Category:** How do I?
**Tags:** supabase
**Created:** [March 25, 2025, 2:49pm UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438 "2025-03-25T14:49:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Matt](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/matt/32/13947_2.png) [@Matt](https://community.weweb.io/u/Matt)
#### Post date: [March 25, 2025, 2:49pm UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438/1 "2025-03-25T14:49:17Z")

</div>

Hey there,  
I hope you’re all doing well!  
I have an issue with the **Supabase auth.**

When I add the roles to my supabse auth plugin, the **login action returns an error**

\_  
Any idea why ?

Could that be the name of my tables that need to match exactly a certain string ?

```auto
name: "TypeError"
stack: "TypeError: Cannot read properties of null (reading 'map') at Object.getUserRoles (https://cdn.weweb.io/components/1fa0dd68-5069-436c-9a7d-3b54c340f1fa/ddaa95e9-ca4c-42d6-8e76-e4efe9108ca7/dist/man..."
message: "Cannot read properties of null (reading 'map')"

```

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/206bdc53c185469174d2c27f5339b424f0f3c81c.png)

---

<div class="post-metadata">

### Author: ![Matt](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/matt/32/13947_2.png) [@Matt](https://community.weweb.io/u/Matt)
#### Post date: [March 25, 2025, 3:53pm UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438/2 "2025-03-25T15:53:32Z")

</div>

In the meantime, I removed the Supabase Auth plugin, reverted to the table names provided by WeWeb, namely:

- roles
- userRoles with userId and roleId I then reinstalled the Auth plugin and tested my login action again. But I’m still getting the same error…

---

<div class="post-metadata">

### Author: ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)
#### Post date: [March 26, 2025, 7:11am UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438/3 "2025-03-26T07:11:30Z")

</div>

Check your RLS, this means that the table is not available, or WeWeb can’t find the columns/can’t access it to look up the roles.

---

<div class="post-metadata">

### Author: ![Matt](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/matt/32/13947_2.png) [@Matt](https://community.weweb.io/u/Matt)
#### Post date: [March 26, 2025, 8:46am UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438/4 "2025-03-26T08:46:12Z")

</div>

I thought so too @Broberto, so i’ve disabled the RLS on my tables, especially roles and userRoles table, but i keep getting the same issue.

Here is the thing:  
in the public schema, I have a table called **user** , with the id being the FK to my auth.users,  
AND I also have a table **operator** with the id also being the FK to my auth.users.

Those operators are some sort of admin of the app.

Maybe this is where the error lies…

---

<div class="post-metadata">

### Author: ![Matt](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/matt/32/13947_2.png) [@Matt](https://community.weweb.io/u/Matt)
#### Post date: [March 26, 2025, 8:52am UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438/5 "2025-03-26T08:52:57Z")

</div>

I think I get where the error lies.  
my Supabase action “Sign in” look in the table “user” and not operator, and since there isn’t any email matching the auth.users it returns an empty array.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/a42a9d87ae05ee1c52577b993fcae265461145f3.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4bdd48ae1596478ad0db847f63fd420b7adff0ca.png)

---

<div class="post-metadata">

### Author: ![Louis.adb](https://avatars.discourse-cdn.com/v4/letter/l/57b2e6/32.png) [@Louis.adb](https://community.weweb.io/u/Louis.adb)
#### Post date: [April 1, 2025, 8:17pm UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438/6 "2025-04-01T20:17:38Z")

</div>

Hi Matt, I have the exact same problem, how did you fix it ? Thanks

---

<div class="post-metadata">

### Author: ![Matt](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/matt/32/13947_2.png) [@Matt](https://community.weweb.io/u/Matt)
#### Post date: [April 2, 2025, 8:42am UTC](https://community.weweb.io/t/supabase-auth-login-error-when-filling-the-roles/17438/7 "2025-04-02T08:42:10Z")

</div>

@Louis.adb I’ve given up to use the native role like weweb offers it to do. I just leave it blank in the configuration.

And I’ve create an app workflow that checks the user role, and redirect if he hasn’t got the right role
