Invoker on view not working

I have a view: user_profiles which I have set invoker = true but I get this error whenever I try to access it from an authenticated role with the correct permissions:

[1] Could not fetch users {
[1]   code: '42501',
[1]   details: null,
[1]   hint: null,
[1]   message: 'permission denied for table users'
[1] }


I know this is an issue with the view specifically as when I change my query to select some columns directly from users it works fine.

View definition:
create view public.user_profiles as
select
  u.first_name,
  u.last_name,
  u.role,
  u.created_at,
  u.customer_id,
  a.email,
  a.last_sign_in_at as last_login_date
from
  users u
  join auth.users a using (id);


Am I missing something?
Was this page helpful?