Pricing Blog

Issues fetching data from Supabase

  • chr.foss-1389561066060644394

    chr.foss

    10 days ago

    Hey guys,

    Super new to Nordcraft & Supabase but I got my login working and I'm setting the auth token cookie and can see the request is authorized in Supabase..
    On my homepage (after login) I'd like to fetch some data and display it, but I can't seem to make the GET request work properly.

    I'm getting a 200 response but with no data in Nordcraft and in Supabase I can see the request (select=*).
    I have one row in the 'tenants' table.

    I'm setting the apiKey in the API setup in NC, but on the Supabase side it says 'anon', is that correct?

    Any ideas?
    1389561066333143180-image.png
    1389561066635399218-image.png
    1389561066949840906-image.png
  • filip_dajkovic-1389574012010762312

    Filip Dajkovic

    10 days ago

    You need to set authorization header in that Get API call
  • chr.foss-1389586513813045308

    chr.foss

    10 days ago

    Yep, done that 🙂
    1389586513540419736-image.png
  • jaycmpb-1389607677570846790

    Jay Campbell

    10 days ago

    Do you have RLS set up to allow users to read the tenants table?

    I have a video on it here if not: https://youtu.be/6fLKL4ZpFUA?si=cBT2sqthBE6uJLh5
  • chr.foss-1389653737705967637

    chr.foss

    10 days ago

    I don’t have that set up, thought that by having no RLS it meant all had access?
  • Tod-1389653739303866601

    Tod

    10 days ago

    Great job @! Your contribution to the Nordcraft Community just made you advance to Community Level 1! 🌲
  • jaycmpb-1389654856809316506

    Jay Campbell

    10 days ago

    By having no RLS but it is enabled, you cannot do anything with the table. If it’s disabled then anyone can do anything with your database.
  • So if it’s enabled but you have no rules, you cannot do anything unless you define the rules.
  • whitep4nth3r-1389658618064011284

    salma

    10 days ago

    Also supabase has RLS on by default, so it’s probably on right now and you haven’t specified any policies
  • chr.foss-1389662834006298706

    chr.foss

    10 days ago

    Got it, I’ll give it a go!

    Many thanks 🙏
  • chr.foss-1389951313147727954

    chr.foss

    9 days ago

    Got it working 🤘

    Thanks a bunch for quick replies