Fix Authentication and Role Assignment in Supabase (with Lovable AI)

Job ID: 39587933

Budget: €30 – €250 EUR

Hi there!

I'm looking for an experienced developer to help me solve a persistent issue with Supabase authentication and role-based access control in an app I'm building with Lovable AI.

Project Context:

I'm building a platform using Supabase and Lovable (an AI-powered app builder).
The app includes 4 user roles: Admin, Lawyer, Expert, and Client.
Users should be able to register and select their role.
Each Expert should only be able to see Clients they invited (kind of a multi-tenant setup).

What I Need From You:
Ensure that new users are correctly assigned a role.
Create a secure system where Experts can only access their invited Clients.
Possibly restructure the database and role logic if necessary.
Suggest and apply best practices for multi-role, multi-tenant logic in Supabase.