Getting 403 even if policy allow read access to all users

I have created a profiles table that stores details of authenticated users. I have got this Idea from the documentation.

I'm using supabase for the first time. I have setup the policy of this table to "allow access to all users to read profiles." Still when I'm trying to make a query to the database, it returns the following error:
{
  error: {
    code: '42501',
    details: null,
    hint: null,
    message: 'permission denied for table profiles'
  },
  data: null,
  count: null,
  status: 403,
  statusText: 'Forbidden'
}


I'm using Next js with supabase. I don't have clue of what is wrong here.

Here's the log of API request if it helps:
Was this page helpful?