https://supabase.com/ logo
Join DiscordCommunities
Powered by
# help
  • s

    silentworks

    01/04/2022, 11:44 PM
    Redirect To
  • s

    Steve

    01/05/2022, 1:03 AM
    api schemas
  • a

    Anoushk

    01/05/2022, 5:00 AM
    i have added this as an issue now https://github.com/supabase/supabase-js/issues/339
    j
    d
    • 3
    • 19
  • n

    Nascode

    01/05/2022, 5:52 AM
    Hi there, newbie Supabase user here 🙂 I want to create admin panel for a web app. What is your recommendation if I want to login like usual in client side, then do administrative task in this admin panel? 1. Make much more complex RLS policies that check user's
    isAdmin
    column. So user can login with anon key clientside. 2. Send the JWT after client side login to serverside. Verify it. And do administrative supabase function with servicekey.
    m
    • 2
    • 1
  • a

    Anoushk

    01/05/2022, 9:40 AM
    User undefined on refresh
  • h

    Hal

    01/05/2022, 10:20 AM
    how do I add a button to resend email confirmation?
    s
    • 2
    • 4
  • x

    xtc

    01/05/2022, 11:05 AM
    Hi, is it possible to create multiple organisations with self-host?
  • f

    Fibrasek

    01/05/2022, 1:31 PM
    Hi guys, I'm having a weird problem with RLS, I have a
    recipes
    table with a foreign key named
    user_id
    that is related to
    users.uid
    . Then I created a policy on top of
    recipes
    for users to be able to se only what they have created, so I wrote
    (auth.uid() = user_id)
    . The problem is I can't see anything in my app and the queries always return RLS policy error :/
    s
    • 2
    • 23
  • s

    silentworks

    01/05/2022, 2:34 PM
    RLS issue
  • s

    silentworks

    01/05/2022, 2:38 PM
    Resend email confirmation
  • m

    mendozer

    01/05/2022, 2:43 PM
    Admin panel rbac
  • n

    Nick

    01/05/2022, 3:48 PM
    Hey folks, it seems like
    setAuth
    doesn't actually return a user, given a valid access token? https://supabase.com/docs/reference/javascript/auth-setauth
    s
    • 2
    • 2
  • s

    silentworks

    01/05/2022, 4:13 PM
    setAuth
  • n

    Nick

    01/05/2022, 4:15 PM
    Am I reading the docs correctly that using the
    rpc()
    features is in alpha preview?
    s
    • 2
    • 3
  • s

    silentworks

    01/05/2022, 4:26 PM
    RPC feature
  • n

    Nick

    01/05/2022, 4:48 PM
    Anybody have a sec to help me with this? I'm new to plglsql:
    Copy code
    create or replace function get_or_create_api_key(user_id uuid) 
    returns setof api_keys
    language plpgsql
    as $$
    declare 
      kk varchar;
    begin
      select key from api_keys into kk where api_keys.user_id = get_or_create_api_key.user_id;
    
      if not found then
          select digest(gen_random_bytes(32), 'sha512') into kk;
    
          insert into api_keys(key, user_id)
          values (kk, get_or_create_api_key.user_id);
      end if;
      
      select * from api_keys where api_keys.key = kk;
    end;
    $$;
  • n

    Nick

    01/05/2022, 4:48 PM
    how do I return the result of that last statement?
  • c

    carl-ce

    01/05/2022, 4:51 PM
    Hey everyone 🙂 I'm running supabase locally and the api page at
    localhost:54323/project/default/api
    is getting a 401 when communicating with kong - is this a known issue with the local setup?
  • n

    Nick

    01/05/2022, 5:00 PM
    nevermind! Figured something else out
  • n

    Nick

    01/05/2022, 5:08 PM
    ugh, sorry, another question: so I wrote my RPC function and it seems to work nicely, but when I execute it from the client side I hit row level security violations
  • n

    Nick

    01/05/2022, 5:09 PM
    that same function from a few lines above
  • n

    Nick

    01/05/2022, 5:09 PM
    what am I missing?
  • g

    garyaustin

    01/05/2022, 5:15 PM
    You need to add "security definer". After "language plpsql" should be fine. This runs with privileges of the function owner versus user.
  • n

    Nick

    01/05/2022, 5:17 PM
    you're a legend! Thanks!
  • s

    silentworks

    01/05/2022, 5:18 PM
    He is indeed a legend.
  • c

    Christopher

    01/05/2022, 5:34 PM
    Is there a tutorial anywhere about how to set up Azure SAML?
  • r

    rudolfbono

    01/05/2022, 5:36 PM
    Hey guys, I'm using NextJS + Supabase, and am setting up a CI/CD for the frontend with GH Actions. In my GH Action, I have a step where I
    npm run build
    the Next app before running
    npm run test
    . Problem: I get the error
    Error: supabaseUrl is required
    during the build step. This is happening because
    createClient(process.env.NEXT_PUBLIC_SUPABASE_URL ?? '', process.env.SUPABASE_SERVICE_ROLE_KEY ?? '')
    runs on the client-side and I haven't passed those 2 environment variables to the GH action. Solutions I'm looking at: a) Add prod DB environment variables to the GH action so
    createClient()
    doesn't throw an error. This feels too dangerous. b) Create a special 'test' environment and pass its env variables to the GH action. This sounds like a lot of work as I'll have to manually keep the test DB in sync with prod DB. c) Move
    createClient()
    onto server-side and expose the client instance as an API for my frontend to consume. This way,
    npm run build
    wouldn't need those ENV variables to build correctly. Is this even possible? Thoughts 🙂 ?
    s
    • 2
    • 8
  • j

    Joey Cabal

    01/05/2022, 5:52 PM
    Hi I have a question how to reset the password of the project that I have created?
    s
    m
    e
    • 4
    • 8
  • s

    silentworks

    01/05/2022, 6:20 PM
    Reset db password
  • s

    silentworks

    01/05/2022, 6:21 PM
    GH Action and Supabase
1...184185186...316Latest