supabase icon indicating copy to clipboard operation
supabase copied to clipboard

Subscribing to a table returns `Error 401: Unauthorized` instead of containing the new payload content.

Open ninjaaaaah opened this issue 2 years ago • 0 comments

Version

@nuxtjs/supabase: ^0.1.25 nuxt: ^3.0.0-rc.11

Reproduction Link

https://github.com/ninjaaaaah/balay-kix/

Steps to reproduce

On the pages/expenses.vue file, it contains the subscription for the realtime changes to the expense table.

const supabase = useSupabaseClient();

supabase
  .from('expense')
  .on('*', (e) => console.log(e))
  .subscribe();

On the components/add-expense-modal file, it fetches the POST method on the server/api/expense.post.vue which inserts a new record on the expense table.

What is Expected?

The event logged on the console contains the new data inserted to the table in the new field.

What is actually happening?

The event contains an "Error 401: Unauthorized" in the error field.

image

ninjaaaaah avatar Sep 30 '22 14:09 ninjaaaaah